Skip to content

Halite III

Third version of Halite with inspirations from the original.

Overview

Halite III returns to the resource collection mechanics with new twists.

Resources

Implementation

codeclash.arenas.halite3.halite3.Halite3Arena

Halite3Arena(config, **kwargs)

Bases: HaliteArena

Source code in codeclash/arenas/halite3/halite3.py
31
32
33
34
def __init__(self, config, **kwargs):
    super().__init__(config, **kwargs)
    # Remove replaydirectory arg as Halite3 does not support it
    self.run_cmd_round: str = self.run_cmd_round.replace(f"--replaydirectory {self.log_env}", "")

name class-attribute instance-attribute

name: str = 'Halite3'

description class-attribute instance-attribute

description: str = ''

default_args class-attribute instance-attribute

default_args: dict = {}

submission class-attribute instance-attribute

submission: str = 'submission'

executable class-attribute instance-attribute

executable: str = './game_engine/halite'

run_cmd_round instance-attribute

run_cmd_round: str = replace(f'--replaydirectory {log_env}', '')

get_results

get_results(agents: list[Player], round_num: int, stats: RoundStats)
Source code in codeclash/arenas/halite3/halite3.py
52
53
54
55
56
57
58
def get_results(self, agents: list[Player], round_num: int, stats: RoundStats):
    return super().get_results(
        agents,
        round_num,
        stats,
        pattern=HALITE_WIN_PATTERN,
    )

validate_code

validate_code(agent: Player)
Source code in codeclash/arenas/halite3/halite3.py
60
61
62
63
64
65
66
67
68
def validate_code(
    self,
    agent: Player,
):
    return super().validate_code(
        agent,
        MAP_FILE_TYPE_TO_COMPILE,
        MAP_FILE_TYPE_TO_RUN,
    )