Skip to content

Commit

Permalink
Changing naming convention in cartesian tournaments
Browse files Browse the repository at this point in the history
When rotate-ufuns is given, we use - instead of _ to separate the index
from the original name to simplify decomposing the name later
  • Loading branch information
yasserfarouk committed Dec 24, 2023
1 parent 56aca11 commit f059606
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions negmas/tournaments/neg/simple/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from rich import print
from rich.progress import track

from negmas.gb.mechanisms.base import GBMechanism
from negmas.helpers import unique_name
from negmas.helpers.inout import dump
from negmas.helpers.strings import shortest_unique_names
Expand Down Expand Up @@ -255,8 +256,10 @@ def save_as_df(data: list[tuple], names, file_name):

full_name = path / "negotiations" / f"{file_name}.csv"
assert not full_name.exists(), f"{full_name} already found"
if issubclass(mechanism_type, SAOMechanism):
save_as_df(m.extended_trace, ("step", "negotiator", "offer"), full_name) # type: ignore
if issubclass(mechanism_type, SAOMechanism) or issubclass(
mechanism_type, GBMechanism
):
save_as_df(m.full_trace, ("time", "relative_time", "step", "negotiator", "offer", "responses", "state"), full_name) # type: ignore
for i, negotiator in enumerate(m.negotiators):
neg_name = (
path
Expand Down Expand Up @@ -464,7 +467,7 @@ def shorten(name):
scenario = Scenario(
type(s.outcome_space)(
issues=s.outcome_space.issues,
name=f"{original_name}_{i}" if i else original_name,
name=f"{original_name}-{i}" if i else original_name,
),
tuple(ufuns),
)
Expand Down

0 comments on commit f059606

Please sign in to comment.