Exemplo n.º 1
0
 def __init__(self):
     SettingLoader.__init__(self)
     Communicator.__init__(self)
     self.space_subdivisions = 10
     self.actions = None
     self.action_list = None
     self.states = None
     self.init_state = None
     self.ind2state = None
     self.state2ind = None
     self.alpha = 0
     self.gamma = 0
     self.episode_max = 300
Exemplo n.º 2
0
    def __init__(self, headless=True):
        SettingLoader.__init__(self)
        Communicator.__init__(self)
        # self.show_every_n_episodes = 10
        self.headless = headless
        if not self.headless:
            super().__init__()

        self.jellys = {}
        self.p1_rl_model = None
        self.king_fish = None

        self.state2ind = None
        self.ind2state = None

        self.actions = None
        self.allowed_moves = None
        self.actions2ind = None  # ?
        self.exploration = True

        self.policy = None
        self.episode_len_count = 0
        self.episode_len = None
        self.game_over = False

        # Create class variables and set default values
        self.king_fish = None
        self.fishes = {}  # Dictionary of fishes
        self._cnt_steps = 0  # Count of the number of steps taken so far
        self.move_x = []  # Next moves of the fishes in the x axis
        self.move_y = []  # Next moves of the fishes in the y axis
        self.action = "stay"  # Actions received from player
        self.time = 0  # Seconds since start
        self.total_time = 60  # Total time of the game
        self.player = None
        self.time_board = None  # Time board widget
        # PID of the player loop in order to be able to kill it when the game is over
        self.player_loop_pid = None
        self.models = None
        self.update_scheduled = None
        self.timer_scheduled = None
        self.space_subdivisions = 10
        self.frames_per_action = 10
        self.fishderby = None  # Main widget of the game
        self.n_jelly = 0
        if not self.headless:
            Builder.load_file('main.kv')
Exemplo n.º 3
0
    def __init__(self):
        App.__init__(self)
        SettingLoader.__init__(self)
        Communicator.__init__(self,
                              receiver_threshold=constants.STEP_TIME_THRESHOLD)

        # Create class variables and set default values
        self.fishes = {}  # Dictionary of fishes
        self._cnt_steps = 0  # Count of the number of steps taken so far
        self.move_x = []  # Next moves of the fishes in the x axis
        self.move_y = []  # Next moves of the fishes in the y axis
        self.time = 0  # Seconds since start
        self.total_time = 60  # Total time of the game
        self.players = []  # Players list
        self.main_widget = None  # Main widget of the game
        self.time_board = None  # Time board widget
        # PID of the player loop in order to be able to kill it when the game is over
        self.player_loop = None
        self.observations_sequence = None
        self.models = None
        self.update_scheduled = None
        self.timer_scheduled = None

        self.frames_per_action = 10
Exemplo n.º 4
0
 def __init__(self):
     SettingLoader.__init__(self)
     Communicator.__init__(self)
Exemplo n.º 5
0
 def __init__(self, lock=None, reconnect=None):
     Communicator.__init__(self, lock)
     self.reconnect = reconnect