Exemplo n.º 1
0
    def __init__(self, wm):
        Controller.__init__(self, wm)
        self.nb_hiddens = 14
        self.nb_zones = 6

        self.wantDrop = False
        self.wantTake = False
        self.setObjCollected(False)
        self.setCanInstantDrop(False)

        #x = random.randint(250, 650)
        #y = random.randint(120, 650)
        #self.set_position(x,y)

        self.setIsObserved(False)

        self.weights = [
            np.random.normal(0, 1, (self.nb_sensors + 4, self.nb_hiddens)),
            np.random.normal(0, 1, (self.nb_hiddens, 4))
        ]
        self.tot_weights = np.sum(
            [np.prod(layer.shape) for layer in self.weights])
        self.zones = np.zeros(self.nb_zones)

        self.fitness = 0
        self.s = 0  # pour stocker la distance euclidienne

        self.objects_transported = []
        self.object_fitness = np.zeros(25)

        self.id_object_transported = 0  # pour savoir quel objet on transporte actuellement
Exemplo n.º 2
0
 def __init__(self, world_model):
     self.rot_speed = 0.5
     # It is *mandatory* to call the super constructor before any other operation to
     # link the python object to its C++ counterpart
     Controller.__init__(self, world_model)
     self.rob = Pyroborobo.get()
     print("I'm a Python controller")
Exemplo n.º 3
0
 def __init__(self, world_model):
     # It is *mandatory* to call the super constructor before any other operation to
     # link the python object to its C++ counterpart
     Controller.__init__(self, world_model)
     self.rob = Pyroborobo.get()
     self.camera_max_range = 0
     self.repulse_radius = 0
     self.orientation_radius = 0
Exemplo n.º 4
0
 def __init__(self, world_model):
     # It is *mandatory* to call the super constructor before any other operation to link the python object to its C++ counterpart
     Controller.__init__(self, world_model)
     assert self.nb_sensors == 8, "SimpleController only works with 8 sensors"
     print("I'm a Python controller")
Exemplo n.º 5
0
 def __init__(self, wm):
     Controller.__init__(self, wm)
     self.nb_hiddens = 10
     self.weights = [np.random.normal(0, 1, (self.nb_sensors + 1, self.nb_hiddens)),
                     np.random.normal(0, 1, (self.nb_hiddens, 2))]
     self.tot_weights = np.sum([np.prod(layer.shape) for layer in self.weights])