コード例 #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
コード例 #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]
コード例 #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"
コード例 #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
コード例 #5
0
ファイル: foraging_task.py プロジェクト: chielk/NEATThymio
 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
コード例 #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)
コード例 #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)
コード例 #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]
コード例 #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
コード例 #10
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
コード例 #11
0
ファイル: foraging_task.py プロジェクト: chielk/NEATThymio
    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
コード例 #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
コード例 #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