def generateNNs(): for i in range(20): c = Chrono() runNN("X" + str(i), True) c.stop()
def generateNNs(): for i in range(20): c = Chrono() runNN("X"+str(i),True) c.stop()
def chooseFunction(choix): if choix == 1: plotVelocityProfile("Brent") elif choix == 2: plotArticularPositions("Brent") elif choix == 3: plotXYPositions("Brent") elif choix == 4: plotMuscularActivations("Brent") #------------------------------------------- NN elif choix == 5: rorc = input("enter 1 if random or 2 if training: ") rorc = int(rorc) if rorc == 1: saveRandomNN() else: name = raw_input('Name of file to save the NN controller: ') c = Chrono() runNN(name) c.stop() elif choix == 6: name = raw_input('Name of the NN controller file: ') fname = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") c = Chrono() generateFromNN(nbret, name, fname) c.stop() elif choix == 7: nameF = raw_input('Folder where the results are saved: ') plotVelocityProfile("NN",nameF) elif choix == 8: nameF = raw_input('Folder where the results are saved: ') rorc = input("enter 1 if XY or 2 if Joint results: ") rorc = int(rorc) if rorc == 1: plotXYPositions("NN",nameF,"All",True)#False)# else: plotArticularPositions("NN",nameF) elif choix == 9: nameF = raw_input('Folder where the results are saved: ') plotMuscularActivations("NN",nameF) elif choix == 10: nameF = raw_input('Folder where the results are saved: ') plotCostColorMap("NN",nameF) elif choix == 28: nameF = raw_input('Folder where the results are saved: ') plotXYEstimError("NN",nameF,"All") elif choix == 29: nameF = raw_input('Folder where the results are saved: ') plotXYEstimErrorOfSpeed("NN",nameF,"All") #------------------------------------------- CMAES elif choix == 11: rorc = input("enter 1 if from NN, anything if from previous CMAES: ") save = False rorc = int(rorc) if rorc == 1: save = True name = raw_input('Name of the controller file: ') c = Chrono() launchCMAESForAllTargetSizes(name,save) c.stop() elif choix == 12: nameTheta = raw_input('Name of the controller file: ') name = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") nbret = int(nbret) generateFromCMAES(nbret, nameTheta, name) elif choix == 13: nameF = raw_input('Folder where the results are saved: ') plotVelocityProfile("CMAES",nameF) elif choix == 14: nameF = raw_input('Folder where the results are saved: ') rorc = input("enter 1 if XY or 2 if Joint results: ") rorc = int(rorc) if rorc == 1: plotXYPositions("CMAES",nameF,"All",False) else: tSize = raw_input('Target Size: ') plotArticularPositions("CMAES",nameF,tSize) elif choix == 15: nameF = raw_input('Folder where the results are saved: ') tSize = raw_input('Target Size: ') plotMuscularActivations("CMAES",nameF,tSize) elif choix == 16: nameF = raw_input('Folder where the results are saved: ') #tSize = raw_input('Target Size: ') #plotCostColorMap("CMAES",nameF,tSize) plotCostColorMap("CMAES",nameF) elif choix == 17: nameF = raw_input('Folder where the results are saved: ') plotTimeDistanceTarget(nameF) elif choix == 18: nameF = raw_input('Folder where the results are saved: ') plotPerfSizeDist(nameF) elif choix == 19: nameF = raw_input('Folder where the results are saved: ') plotFittsLaw(nameF) elif choix == 20: nameF = raw_input('Folder where the results are saved: ') plotTimeColorMap("CMAES",nameF) elif choix == 21: rorc = input("enter 0 if Brent, 1 if NN or 2 if CMAES results: ") rorc = int(rorc) if rorc == 0: trajectoriesAnimation("Brent") elif rorc == 1: nameF = raw_input('Folder where the results are saved: ') trajectoriesAnimation("NN",nameF) elif rorc == 2: nameF = raw_input('Folder where the results are saved: ') tSize = raw_input('Target Size: ') trajectoriesAnimation("CMAES",nameF, tSize) elif choix == 22: nameF = raw_input('Folder where the results are saved: ') rorc = input("enter 1 if NN or 2 if CMAES results: ") #plotHitDispersion(nameF,"0.05") rorc = int(rorc) if rorc == 1: plotScattergram("NN",nameF) elif rorc == 2: plotScattergram("CMAES",nameF) elif choix == 23: name = raw_input('Name of the controller file: ') rorc = input("enter 1 if from NN, anything if from previous CMAES: ") save = False rorc = int(rorc) if rorc == 1: save = True tSize = raw_input('Target Size: ') c = Chrono() launchCMAESForSpecificTargetSize(float(tSize),name,save) c.stop() elif choix == 24: plotCMAESProgress() elif choix == 25: name = raw_input('Name of the NN controller file: ') fname = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") c = Chrono() generateRichDataFromNN(nbret, name, fname) c.stop() elif choix == 26: nameTheta = raw_input('Name of the controller file: ') name = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") nbret = int(nbret) c = Chrono() generateRichDataFromCMAES(nbret, nameTheta, name) c.stop() elif choix == 27: plotTrajsInRepo() elif choix == 30: nameF = raw_input('Folder where the results are saved: ') plotXYEstimError("CMAES",nameF,"All") elif choix == 31: nameF = raw_input('Folder where the results are saved: ') plotXYEstimErrorOfSpeed("CMAES",nameF,"All") elif choix == 32: plotExperimentSetup() elif choix == 33: plotManipulability() elif choix == 34: plotManipulability2()
def chooseFunction(choix): if choix == 1: plotVelocityProfile("Brent") elif choix == 2: plotArticularPositions("Brent") elif choix == 3: plotXYPositions("Brent") elif choix == 4: plotMuscularActivations("Brent") #------------------------------------------- NN elif choix == 5: rorc = input("enter 1 if random or 2 if training: ") rorc = int(rorc) if rorc == 1: saveRandomNN() else: name = raw_input('Name of file to save the NN controller: ') c = Chrono() runNN(name) c.stop() elif choix == 6: name = raw_input('Name of the NN controller file: ') fname = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") c = Chrono() generateFromNN(nbret, name, fname) c.stop() elif choix == 7: nameF = raw_input('Folder where the results are saved: ') plotVelocityProfile("NN", nameF) elif choix == 8: nameF = raw_input('Folder where the results are saved: ') rorc = input("enter 1 if XY or 2 if Joint results: ") rorc = int(rorc) if rorc == 1: plotXYPositions("NN", nameF, "All", True) #False)# else: plotArticularPositions("NN", nameF) elif choix == 9: nameF = raw_input('Folder where the results are saved: ') plotMuscularActivations("NN", nameF) elif choix == 10: nameF = raw_input('Folder where the results are saved: ') plotCostColorMap("NN", nameF) elif choix == 28: nameF = raw_input('Folder where the results are saved: ') plotXYEstimError("NN", nameF, "All") elif choix == 29: nameF = raw_input('Folder where the results are saved: ') plotXYEstimErrorOfSpeed("NN", nameF, "All") #------------------------------------------- CMAES elif choix == 11: rorc = input("enter 1 if from NN, anything if from previous CMAES: ") save = False rorc = int(rorc) if rorc == 1: save = True name = raw_input('Name of the controller file: ') c = Chrono() launchCMAESForAllTargetSizes(name, save) c.stop() elif choix == 12: nameTheta = raw_input('Name of the controller file: ') name = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") nbret = int(nbret) generateFromCMAES(nbret, nameTheta, name) elif choix == 13: nameF = raw_input('Folder where the results are saved: ') plotVelocityProfile("CMAES", nameF) elif choix == 14: nameF = raw_input('Folder where the results are saved: ') rorc = input("enter 1 if XY or 2 if Joint results: ") rorc = int(rorc) if rorc == 1: plotXYPositions("CMAES", nameF, "All", False) else: tSize = raw_input('Target Size: ') plotArticularPositions("CMAES", nameF, tSize) elif choix == 15: nameF = raw_input('Folder where the results are saved: ') tSize = raw_input('Target Size: ') plotMuscularActivations("CMAES", nameF, tSize) elif choix == 16: nameF = raw_input('Folder where the results are saved: ') #tSize = raw_input('Target Size: ') #plotCostColorMap("CMAES",nameF,tSize) plotCostColorMap("CMAES", nameF) elif choix == 17: nameF = raw_input('Folder where the results are saved: ') plotTimeDistanceTarget(nameF) elif choix == 18: nameF = raw_input('Folder where the results are saved: ') plotPerfSizeDist(nameF) elif choix == 19: nameF = raw_input('Folder where the results are saved: ') plotFittsLaw(nameF) elif choix == 20: nameF = raw_input('Folder where the results are saved: ') plotTimeColorMap("CMAES", nameF) elif choix == 21: rorc = input("enter 0 if Brent, 1 if NN or 2 if CMAES results: ") rorc = int(rorc) if rorc == 0: trajectoriesAnimation("Brent") elif rorc == 1: nameF = raw_input('Folder where the results are saved: ') trajectoriesAnimation("NN", nameF) elif rorc == 2: nameF = raw_input('Folder where the results are saved: ') tSize = raw_input('Target Size: ') trajectoriesAnimation("CMAES", nameF, tSize) elif choix == 22: nameF = raw_input('Folder where the results are saved: ') rorc = input("enter 1 if NN or 2 if CMAES results: ") #plotHitDispersion(nameF,"0.05") rorc = int(rorc) if rorc == 1: plotScattergram("NN", nameF) elif rorc == 2: plotScattergram("CMAES", nameF) elif choix == 23: name = raw_input('Name of the controller file: ') rorc = input("enter 1 if from NN, anything if from previous CMAES: ") save = False rorc = int(rorc) if rorc == 1: save = True tSize = raw_input('Target Size: ') c = Chrono() launchCMAESForSpecificTargetSize(float(tSize), name, save) c.stop() elif choix == 24: plotCMAESProgress() elif choix == 25: name = raw_input('Name of the NN controller file: ') fname = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") c = Chrono() generateRichDataFromNN(nbret, name, fname) c.stop() elif choix == 26: nameTheta = raw_input('Name of the controller file: ') name = raw_input('Folder where you want to save the results: ') nbret = input("Number of repeat for each trajectory (int): ") nbret = int(nbret) c = Chrono() generateRichDataFromCMAES(nbret, nameTheta, name) c.stop() elif choix == 27: plotTrajsInRepo() elif choix == 30: nameF = raw_input('Folder where the results are saved: ') plotXYEstimError("CMAES", nameF, "All") elif choix == 31: nameF = raw_input('Folder where the results are saved: ') plotXYEstimErrorOfSpeed("CMAES", nameF, "All") elif choix == 32: plotExperimentSetup() elif choix == 33: plotManipulability() elif choix == 34: plotManipulability2()