aria-systems-group / regret_synthesis_toolbox

Source code for Regret synthesis for two-player turn-based game played on graphs - ICRA 22
MIT License
0 stars 0 forks source link

Fix MultiObjective Strategy solver #5

Open MuvvalaKaran opened 7 months ago

MuvvalaKaran commented 7 months ago

When running the multiobjective solver in the examples directory, I get the following error.

TypeError                                 Traceback (most recent call last)
Cell In[9], line 1
----> 1 solver = MultiObjectiveSolver(game,
      2                             epsilon=1e-7,
      3                             max_iteration=300,
      4                             stochastic=stochastic,
      5                             adversarial=adversarial)
      6 solver.solve(plot_strategies=plot_strategies,
      7                 plot_graph_with_strategy=plot_graph_with_strategy,
      8                 plot_graph_with_pareto=plot_graph_with_pareto,
   (...)
     12                 view=view,
     13                 format=format)

File ~/Documents/research/regret_syn_toolbox/regret_synthesis_toolbox/src/strategy_synthesis/multiobjective_solver.py:398, in MultiObjectiveSolver.__init__(self, game, stochastic, adversarial, epsilon, round_decimals, round_label_decimals, max_iteration)
    395 self._notconverged_state = None
    396 self._count = 1
--> 398 self._initialize(game)

File ~/Documents/research/regret_syn_toolbox/regret_synthesis_toolbox/src/strategy_synthesis/multiobjective_solver.py:414, in MultiObjectiveSolver._initialize(self, game)
    411     raise Exception(f"{init_node} not in the system's winning region")
    412 self._game.delete_selfloops()
--> 414 self._upperbounds = self._compute_upperbound_for_pareto_points()
    416 self._pareto_fronts = None
    417 self._strategies = None

File ~/Documents/research/regret_syn_toolbox/regret_synthesis_toolbox/src/strategy_synthesis/multiobjective_solver.py:431, in MultiObjectiveSolver._compute_upperbound_for_pareto_points(self)
    429 for name in self._game.weight_types:
    430     weights = [e[2]['weights'].get(name) for e in self._game._graph.edges.data() if 'weights' in e[2]]
--> 431     max_single_weight = max(weights)
    432     max_weights.append(max_depth * max_single_weight)
    434 return max_weights

TypeError: '>' not supported between instances of 'list' and 'int'

To reproduce this error, checkout the branch fix/wombats_examples where I already added wombats library as a submodule. Further, I updated the dockerfile and updated the graph_factory.get('ProductGraph', ...) function signature with pdfa_compose= True flag.

MuvvalaKaran commented 1 week ago

@watakandai just a reminder.