def buildExperiment(alpha, gamma, lambdaa, importance): net=nef.Network('HandWired parameters of RL node to bias') net.add_to_nengo() rl = rl_sarsa.qlambda("RL", noStateVars=2, noActions=4, noValues=20, logPeriod=2000) world = gridworld.benchmarkA("map_20x20","BenchmarkGridWorldNodeC",10000); net.add(rl) # place them into the network net.add(world) # connect them together net.connect(world.getOrigin(QLambda.topicDataIn), rl.newTerminationFor(QLambda.topicDataIn)) net.connect(rl.getOrigin(QLambda.topicDataOut), world.getTermination(QLambda.topicDataOut)) # define the parameter sources (controllable from the simulation window) net.make_input('alpha',[alpha]) net.make_input('gamma',[gamma]) net.make_input('lambda',[lambdaa]) net.make_input('importance',[importance]) # connect signal sources to the RL node net.connect('alpha', rl.getTermination(QLambda.topicAlpha)) net.connect('gamma', rl.getTermination(QLambda.topicGamma)) net.connect('lambda', rl.getTermination(QLambda.topicLambda)) net.connect('importance', rl.getTermination(QLambda.topicImportance)) return net
def buildExperiment(alpha, gamma, lambdaa, importance): net = nef.Network('HandWired parameters of RL node to bias') net.add_to_nengo() rl = rl_sarsa.qlambda("RL", noStateVars=2, noActions=4, noValues=20, logPeriod=2000) world = gridworld.benchmarkA("map_20x20", "BenchmarkGridWorldNodeC", 10000) net.add(rl) # place them into the network net.add(world) # connect them together net.connect(world.getOrigin(QLambda.topicDataIn), rl.newTerminationFor(QLambda.topicDataIn)) net.connect(rl.getOrigin(QLambda.topicDataOut), world.getTermination(QLambda.topicDataOut)) # define the parameter sources (controllable from the simulation window) net.make_input('alpha', [alpha]) net.make_input('gamma', [gamma]) net.make_input('lambda', [lambdaa]) net.make_input('importance', [importance]) # connect signal sources to the RL node net.connect('alpha', rl.getTermination(QLambda.topicAlpha)) net.connect('gamma', rl.getTermination(QLambda.topicGamma)) net.connect('lambda', rl.getTermination(QLambda.topicLambda)) net.connect('importance', rl.getTermination(QLambda.topicImportance)) return net