Ejemplo n.º 1
0
 def __init__(self,
              thymioController,
              commit_sha,
              debug=False,
              experimentName='NEAT_task',
              evaluations=EVALUATIONS,
              timeStep=0.005,
              activationFunction='tanh',
              popSize=POPSIZE,
              generations=GENERATIONS,
              solvedAt=1000):
     TaskEvaluator.__init__(self, thymioController, commit_sha, debug,
                            experimentName, evaluations, timeStep,
                            activationFunction, popSize, generations,
                            solvedAt)
     self.camera = CameraVisionVectors(False, self.logger)
     self.ctrl_thread_started = False
     self.img_thread_started = False
     self.individuals_evaluated = 0
     self.presenceValues = []
     self.presence = []
     self.prev_presence = []
     self.conditionLock = Condition()
     self.motorLock = Lock()
     self.presenceValuesReady = False
Ejemplo n.º 2
0
    def __init__(
        self,
        thymioController,
        commit_sha,
        local_ip,
        debug=False,
        experimentName=EXPERIMENT_NAME,
        evaluations=EVALUATIONS,
        timeStep=TIME_STEP,
        activationFunction=ACTIVATION_FUNC,
        popSize=POPSIZE,
        generations=GENERATIONS,
        solvedAt=SOLVED_AT,
    ):

        TaskEvaluator.__init__(
            self,
            thymioController,
            commit_sha,
            local_ip,
            debug,
            experimentName,
            evaluations,
            timeStep,
            activationFunction,
            popSize,
            generations,
            solvedAt,
        )
        self.ctrl_thread_started = False
        self.sensors_max = pr.SENSORS_MAX[local_ip]
Ejemplo n.º 3
0
 def __init__(self, thymioController, commit_sha, debug=False, experimentName=EXPERIMENT_NAME, evaluations=EVALUATIONS, timeStep=0.005, activationFunction='tanh', popSize=POPSIZE, generations=GENERATIONS, solvedAt=1000):
     TaskEvaluator.__init__(self, thymioController, commit_sha, debug, experimentName, evaluations, timeStep, activationFunction, popSize, generations, solvedAt)
     self.ctrl_thread_started = False
     self.hitWallCounter = 0
     self.atWall = False
     self.log_wall_counter(experimentName)
     print "New obstacle avoidance task"
Ejemplo n.º 4
0
 def __init__(self, thymioController, commit_sha, debug=False, experimentName='NEAT_task', evaluations=EVALUATIONS,
              timeStep=0.005, activationFunction='tanh', popSize=POPSIZE, generations=GENERATIONS, solvedAt=1000):
     TaskEvaluator.__init__(self, thymioController, commit_sha, debug, experimentName, evaluations, timeStep,
                            activationFunction, popSize, generations, solvedAt)
     self.camera = CameraVisionVectors(False, self.logger)
     self.ctrl_thread_started = False
     self.img_thread_started = False
     self.individuals_evaluated = 0
Ejemplo n.º 5
0
 def __init__(self, thymioController, commit_sha, local_ip, debug=False,
              experimentName=EXPERIMENT_NAME, evaluations=EVALUATIONS, 
              timeStep=TIME_STEP, activationFunction=ACTIVATION_FUNC, 
              popSize=POPSIZE, generations=GENERATIONS, solvedAt=SOLVED_AT):
     
     TaskEvaluator.__init__(self, thymioController, commit_sha, local_ip, 
                            debug, experimentName, evaluations, timeStep, 
                            activationFunction, popSize, generations, solvedAt)
     self.camera = CameraVisionVectors(False, self.logger)
     self.ctrl_thread_started = False
     self.img_thread_started = False
     self.individuals_evaluated = 0
Ejemplo n.º 6
0
    def evaluate(self, evaluee):
        global ctrl_client
        if ctrl_client and not self.ctrl_thread_started:
            thread.start_new_thread(check_stop, (self,))
            self.ctrl_thread_started = True

        return TaskEvaluator.evaluate(self, evaluee)
Ejemplo n.º 7
0
    def evaluate(self, evaluee):
        global ctrl_client
        if ctrl_client and not self.ctrl_thread_started:
            thread.start_new_thread(check_stop, (self, ))
            self.ctrl_thread_started = True

        return TaskEvaluator.evaluate(self, evaluee)
Ejemplo n.º 8
0
    def __init__(self,
                 thymioController,
                 commit_sha,
                 local_ip,
                 debug=False,
                 experimentName=EXPERIMENT_NAME,
                 evaluations=EVALUATIONS,
                 timeStep=TIME_STEP,
                 activationFunction=ACTIVATION_FUNC,
                 popSize=POPSIZE,
                 generations=GENERATIONS,
                 solvedAt=SOLVED_AT):

        TaskEvaluator.__init__(self, thymioController, commit_sha, local_ip,
                               debug, experimentName, evaluations, timeStep,
                               activationFunction, popSize, generations,
                               solvedAt)
        self.ctrl_thread_started = False
        self.sensors_max = pr.SENSORS_MAX[local_ip]
Ejemplo n.º 9
0
    def evaluate(self, evaluee):
        global ctrl_client
        if ctrl_client and not self.ctrl_thread_started:
            thread.start_new_thread(check_stop, (self, ))
            self.ctrl_thread_started = True

        result = TaskEvaluator.evaluate(self, evaluee)
        self.write_wall_log()
        self.hitWallCounter = 0
        self.atWall = False
        return result
    def evaluate(self, evaluee):
        global ctrl_client
        if ctrl_client and not self.ctrl_thread_started:
            thread.start_new_thread(check_stop, (self, ))
            self.ctrl_thread_started = True

        result = TaskEvaluator.evaluate(self, evaluee)
        self.write_wall_log()
        self.hitWallCounter = 0
        self.atWall = False
        return result
Ejemplo n.º 11
0
    def __init__(self,
                 thymioController,
                 commit_sha,
                 local_ip,
                 debug=False,
                 experimentName=EXPERIMENT_NAME,
                 evaluations=EVALUATIONS,
                 timeStep=TIME_STEP,
                 activationFunction=ACTIVATION_FUNC,
                 popSize=POPSIZE,
                 generations=GENERATIONS,
                 solvedAt=SOLVED_AT):

        TaskEvaluator.__init__(self, thymioController, commit_sha, local_ip,
                               debug, experimentName, evaluations, timeStep,
                               activationFunction, popSize, generations,
                               solvedAt)
        self.camera = CameraVisionVectors(False, self.logger)
        self.ctrl_thread_started = False
        self.img_thread_started = False
        self.individuals_evaluated = 0
Ejemplo n.º 12
0
 def __init__(self, thymioController, commit_sha, debug=False):
     TaskEvaluator.__init__(self, thymioController, commit_sha, debug, EXPERIMENT_NAME, EVALUATIONS, TIME_STEP,
                            ACTIVATION_FUNC, POPSIZE, GENERATIONS, SOLVED_AT)
     self.camera = CameraVisionVectors(False, self.logger)
     self.ctrl_thread_started = False
     self.img_thread_started = False
     self.individuals_evaluated = 0
     self.presenceValues = []
     self.presence = []
     self.prev_presence = []
     self.conditionLock = Condition()
     self.conditionGoalReached = Condition()
     self.motorLock = Lock()
     self.presenceValuesReady = False
     self.proxvalues = [-1, -1]
     self.goalReached = False
     self.puckRemoved = False
     self.hasPuck = False
     self.puckLostCounter = 0
     self.goalReachedWaiter = 0
     self.goalReachedCounter = 0
Ejemplo n.º 13
0
 def __init__(
     self,
     thymioController,
     commit_sha,
     debug=False,
     experimentName="NEAT_task",
     evaluations=EVALUATIONS,
     timeStep=0.005,
     activationFunction="tanh",
     popSize=POPSIZE,
     generations=GENERATIONS,
     solvedAt=1000,
 ):
     TaskEvaluator.__init__(
         self,
         thymioController,
         commit_sha,
         debug,
         experimentName,
         evaluations,
         timeStep,
         activationFunction,
         popSize,
         generations,
         solvedAt,
     )
     self.camera = CameraVisionVectors(False, self.logger)
     self.ctrl_thread_started = False
     self.img_thread_started = False
     self.individuals_evaluated = 0
     self.presenceValues = []
     self.presence = []
     self.prev_presence = []
     self.conditionLock = Condition()
     self.motorLock = Lock()
     self.presenceValuesReady = False