diff --git a/moptipyapps/ttp/experiment.py b/moptipyapps/ttp/experiment.py index 721f9dfb..b122bd09 100644 --- a/moptipyapps/ttp/experiment.py +++ b/moptipyapps/ttp/experiment.py @@ -38,7 +38,7 @@ def base_setup(instance: Instance) -> tuple[Permutations, Execution]: """ ge: Final[GameEncoding] = GameEncoding(instance) perms: Final[Permutations] = ge.search_space() - return (perms, Execution().set_max_fes(16_777_216).set_log_improvements( + return (perms, Execution().set_max_fes(1000000000).set_log_improvements( True).set_objective(Errors(instance)).set_search_space(perms) .set_solution_space(GamePlanSpace(instance)).set_encoding( GameEncoding(instance))) diff --git a/moptipyapps/ttp/game_plan.py b/moptipyapps/ttp/game_plan.py index 245f2d2c..75785127 100644 --- a/moptipyapps/ttp/game_plan.py +++ b/moptipyapps/ttp/game_plan.py @@ -40,6 +40,17 @@ def __str__(self): """ Convert the game plan to a compact string. + The first line of the output is a flattened version of this matrix + with the values being separated by `;`. Then we place an empty line. + + We then put a more easy-to-read representation and follow the pattern + given at https://robinxval.ugent.be/RobinX/travelRepo.php, which is + based upon the notation by Easton et al. Here, first, a row with the + team names separated by spaces is generated. Then, each row contains + the opponents of these teams, again separated by spaces. If an + opponent plays at their home, this is denoted by an `@`. + If a team has no scheduled opponent, then this is denoted as `-`. + :return: the compact string """ csv: Final[str] = CSV_SEPARATOR @@ -67,11 +78,11 @@ def __str__(self): for d in row: sio.write(sep) if d < 0: - idx = -d - 1 - sio.write("@") + sio.write(f"@{teams[-d - 1]}") + elif d > 0: + sio.write(teams[d - 1]) else: - idx = d - 1 - sio.write(teams[idx]) + sio.write("-") sep = " " return sio.getvalue() diff --git a/moptipyapps/version.py b/moptipyapps/version.py index afb63322..3108f0ca 100644 --- a/moptipyapps/version.py +++ b/moptipyapps/version.py @@ -1,4 +1,4 @@ """An internal file with the version of the `moptipyapps` package.""" from typing import Final -__version__: Final[str] = "0.8.22" +__version__: Final[str] = "0.8.23"