Commit 98d09104 authored by Andres Yeral Vasilev Viera's avatar Andres Yeral Vasilev Viera
Browse files

Added close to communication class

parents 34babc4f 41f7330f
......@@ -132,8 +132,6 @@ class Individual:
#plt.show()
startingCyclePose = self.getPrecycleLength()
executionConcatenationGap = self.individualGeneticMaterial.getConcatenationGap(startingCyclePose)
self.fitness = self.lucy.getFitness(self.length, executionConcatenationGap)
......
......@@ -46,6 +46,7 @@ max_score = 0
max_score_generation = 0
convergenceCriteria = False
experimentDir = ""
experimentTime = ""
def storeExperimentGAparameters():
conf = LoadSystemConfiguration()
......@@ -188,6 +189,8 @@ def generationCallback(ga_engine):
if gen == 0:
global experimentDir
experimentDir = geneticPoolDir + timestr
global experimentTime
experimentTime = timestr
os.mkdir(experimentDir)
storeExperimentGAparameters()
......@@ -209,10 +212,13 @@ def generationCallback(ga_engine):
# This function is the evaluation function
def eval_func(chromosome):
conf = LoadSystemConfiguration()
if not initialPopulationSetted:
setInitialPopulation(gaEngine)
input_fitness = raw_input("Press any key to evaluate candidate.")
prop = DTIndividualPropertyVanillaEvolutive()
physicalProp = DTIndividualPropertyPhysicalBioloid()
......@@ -251,8 +257,8 @@ def eval_func(chromosome):
#individual.setLength(embryoLength)
fitness = individual.execute() #return the fitness resulting from the simulator execution
input_fitness = raw_input("Ingresar fitness")
print input_fitness
input_fitness = float(raw_input("Write fitness: "))
print "Fitness inserted:", str(input_fitness)
#Vasi cambiar fitness por esperar entrada teclado
if int(conf.getProperty("re-evaluate fittest?"))==True:
......@@ -368,7 +374,7 @@ def run_main():
shutil.copy2('pyevolve.db', experimentDir)
shutil.copy2(conf.getProperty("System Log"), experimentDir)
os.system("pyevolve_graph.py -i \"Lucy walk\" -3 -o gene_pool/experiment_img/" + timestr + " -e png")
os.system("pyevolve_graph.py -i \"Lucy walk\" -3 -o gene_pool/experiment_img/" + experimentTime + " -e png")
#do the stats
print ga.getStatistics()
......
lucy
====
<a href="http://www.youtube.com/watch?feature=player_embedded&v=WXh__TIk7b8" target="_blank"><img src="http://img.youtube.com/vi/WXh__TIk7b8/0.jpg"
alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
......@@ -148,7 +148,7 @@
<!-- 0 means not concatenate cycles, n > 1; means that the cycle will be repeated n times-->
<!--<Value>16</Value>-->
<!--<Value>11</Value>-->
<Value>5</Value>
<Value>2</Value>
</Property>
<Property>
<!-- once a good wal cycle is found, is used as pre-cycle to search for the following cycle-->
......@@ -209,6 +209,6 @@
</Property>
<Property>
<Name>Convergence criteria enable?</Name>
<Value>0</Value>
<Value>1</Value>
</Property>
</System>
......@@ -266,4 +266,4 @@ class DTIndividualGeneticMatrixWalk(DTIndividualGeneticMaterial):
xrange(cycleSize)] * CYCLE_REPETITION
#for debugging info:
#self.calculateGapByInterpolation(REFERENCE_WINDOW_RADIUS, INTERPOLATION_WINDOW, SPLINE_SMOOTHING_FACTOR, cycleSize, CYCLE_REPETITION, True)
self.calculateGapByCubicInterpolation(REFERENCE_WINDOW_RADIUS, INTERPOLATION_WINDOW, SPLINE_SMOOTHING_FACTOR, cycleSize, CYCLE_REPETITION)
#self.calculateGapByCubicInterpolation(REFERENCE_WINDOW_RADIUS, INTERPOLATION_WINDOW, SPLINE_SMOOTHING_FACTOR, cycleSize, CYCLE_REPETITION)
......@@ -108,7 +108,7 @@ class DTIndividualPropertyCMUDaz(DTIndividualProperty):
#self.avoidJoints = ["L_Elbow_Yaw", "R_Elbow_Yaw", "L_Shoulder_Yaw", "R_Shoulder_Yaw", "R_Hip_Yaw", "L_Hip_Yaw", "L_Ankle_Roll", "R_Ankle_Roll", "L_Hip_Roll", "R_Hip_Roll"]
self.diffAvoidJoints = self.avoidJoints
self.poseFix["R_Shoulder_Yaw"] = -101
self.poseFix["R_Shoulder_Pitch"] = -22.6
self.poseFix["R_Shoulder_Pitch"] = 110
self.poseFix["R_Hip_Yaw"] = -202
self.poseFix["R_Hip_Roll"] = -4
self.poseFix["R_Hip_Pitch"] = -27.5
......@@ -120,7 +120,7 @@ class DTIndividualPropertyCMUDaz(DTIndividualProperty):
self.poseFix["R_Ankle_Roll"] = -48
self.poseFix["L_Shoulder_Yaw"] = -125
self.poseFix["L_Shoulder_Pitch"] = -42.5
self.poseFix["L_Shoulder_Pitch"] = 110
self.poseFix["L_Hip_Yaw"] = 142
self.poseFix["L_Hip_Roll"] = -56
self.poseFix["L_Hip_Pitch"] = -25.8
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment