Ejemplo n.º 1
0
    def __init__(self):
        self._world = World()
        configs = Configs()

        self._result = {'world_size': '{0},{1}'.format(*self._world.get_size()),
                        'plant_max_age': configs.get_plant_max_age(),
                        'plant_matured_age': configs.get_plant_matured_age(),
                        'action_delay': configs.get_robots_actions_delay(),
                        'maximum_energy': configs.get_robots_maximum_energy(),
                        'birth_required_honor': configs.get_robots_birth_required_honor()}
Ejemplo n.º 2
0
    def __init__(self):
        self._world = World()
        configs = Configs()

        self._result = {
            'world_size': '{0},{1}'.format(*self._world.get_size()),
            'plant_max_age': configs.get_plant_max_age(),
            'plant_matured_age': configs.get_plant_matured_age(),
            'action_delay': configs.get_robots_actions_delay(),
            'maximum_energy': configs.get_robots_maximum_energy(),
            'birth_required_honor': configs.get_robots_birth_required_honor()
        }
Ejemplo n.º 3
0
    def __init__(self, id, password, name=""):
        super(Robot, self).__init__()

        if not isinstance(name, str) or len(name) > MAX_ROBOT_NAME:
            raise LongRobotNameError("Robot name cannot be longer than {0}".format(MAX_ROBOT_NAME))

        configs = Configs()

        self._id = id
        self._name = name
        self._alive = True
        self._password = password
        self._x = 0
        self._y = 0
        self._has_water = False
        self._energy = configs.get_robots_initial_energy()
        self._maximum_energy = configs.get_robots_maximum_energy()
        self._life = configs.get_robots_initial_life()
        self._honor = 0
        self._last_executed_action_time = 0