summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sol.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/sol.py b/sol.py
index ca163ce..c4d8458 100644
--- a/sol.py
+++ b/sol.py
@@ -21,7 +21,8 @@ alpha_reduction = 0.9998
friendlyness = 0.7 # probability that the model actually performs the action we've requested.
# the model will perform a random other actions with probability of (1-friendlyness)/3.
# putting 0.25 here will make it just random.
-frameskip = 99
+frameskip_array = 99
+frameskip_nn = 0
visu = True
@@ -72,7 +73,8 @@ if arg['-h']:
" nn -> neural network representation\n" +
" default: array" +
" --frameskip NUM # frameskip for visualisation\n" +
- " # default: %f\n" % frameskip +
+ " # default: %f for --qfunc array\n" % frameskip_array +
+ " # %f for --qfunc nn\n" % frameskip_nn +
" --sleep # sleep after every <frameskip> frames\n"+
" --quiet # disable visualisation\n" +
" --file FILE # output file for q learning")
@@ -87,7 +89,7 @@ if arg['--sleep']:
do_sleep = True
if arg['--frameskip']:
- frameskip = int(arg['--frameskip'])
+ frameskip_array=frameskip_nn = int(arg['--frameskip'])
if arg['--episodes']:
n_episodes = int(arg['--episodes'])
@@ -354,8 +356,10 @@ a = World(maze, start)
Q = None
if arg['--qfunc'] == "nn":
Q = QNN()
+ frameskip = frameskip_nn
else:
Q = QArray()
+ frameskip = frameskip_array
i=0
stopstate = -1