Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
machine_learning
skython
Commits
859230b8
Commit
859230b8
authored
Aug 06, 2015
by
Trevor Cappallo
Browse files
whittled down
parent
3c7f45bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
skython.py
skython.py
+8
-9
No files found.
skython.py
View file @
859230b8
...
...
@@ -10,12 +10,10 @@ import random
import
time
EXPLORE
=
True
class
Skython
(
object
):
MAGIC_NUMBER
=
None
#-12345
MAX_PROG_SIZE
=
100
STEP_LIMIT
=
1
5
0
STEP_LIMIT
=
1
0
0
SHRINK
=
True
TRIM
=
15
...
...
@@ -292,7 +290,7 @@ class Skython(object):
def
run
(
self
,
model_out
,
model_in
=
None
,
bound
=
50
):
timeout
=
total
=
redundant
=
degen
=
0
exact
=
0
exact
=
1
#lower_bound, upper_bound = 5, 15
if
model_in
is
None
:
...
...
@@ -372,15 +370,16 @@ class Skython(object):
if
__name__
==
'__main__'
:
skyt
=
Skython
()
# EXPLORE = True
EXPLORE
=
True
skyt
.
INSTRUCTIONS3
=
[
'SWAB'
,
'PUSH'
,
'INC'
,
'ADD'
,
'DIV'
,
'MULT'
,
'NEG'
,
'XOR'
,
'LOCO_2'
,
'SWBC'
,
'ADD'
,
'NEG'
,
'XOR'
,
#
'LOCO_2',
#
'SWBC',
'PEEK'
,
'IFF'
,
'NOT'
,
'LOCO_
1
'
,
'JNE'
,
#
'IFF',
#
'LOCO_
0
',
'JNE'
,
#'JGTE',
]
skyt
.
ENABLED_CODES
=
[
skyt
.
OP_CODE
[
x
]
for
x
in
skyt
.
INSTRUCTIONS3
]
# random.sample(range(30), random.randint(12, 26))
...
...
@@ -459,4 +458,4 @@ if __name__ == '__main__':
print
[
skyt
.
INSTRUCTIONS
[
x
]
for
x
in
sorted
(
skyt
.
ENABLED_CODES
)]
#skyt.run(model_out=[1,2,3,3,4,5], model_in=[4,3,1,3,5,2], bound=30)
#skyt.run(model_out=[19,23,37,37,42], model_in=[23,37,42,37,19], bound=35)
skyt
.
run
(
model_out
=
model_out
,
model_in
=
model_in
,
bound
=
5
0
)
skyt
.
run
(
model_out
=
model_out
,
model_in
=
model_in
,
bound
=
1
5
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment