Skip to content

Commit

Permalink
Merge branch 'Serious-senpai:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
khoint5304 authored Nov 26, 2023
2 parents dc12a5f + 43eb1e3 commit e64c72a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Combine solutions and compare
run: |
export PYTHONPATH=$GITHUB_WORKSPACE
python scripts/compare.py pr-#${{ github.event.issue.number }}.json main.json
python scripts/d2d-compare.py pr-#${{ github.event.issue.number }}.json main.json
- name: Upload compare result
uses: actions/upload-artifact@v3
Expand Down
23 changes: 23 additions & 0 deletions scripts/d2d-compare.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import json
import sys
from typing import Dict, List, Tuple

from ts import utils


pareto_fronts: Dict[str, List[Tuple[float, float]]] = {}
for file in sys.argv[1:]:
with open(file, "r") as f:
data = json.load(f)

pareto_fronts[file] = []
for d in data["solutions"]:
pareto_fronts[file].append(d["cost"])


utils.plot_multi_fronts(
[(front, file) for file, front in pareto_fronts.items()],
dump="compare.png",
xlabel="Service duration (s)",
ylabel="Total waiting time (s)",
)

0 comments on commit e64c72a

Please sign in to comment.