File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -897,24 +897,20 @@ def __str__(self) -> str:
897
897
898
898
def __eq__ (self , other ) -> bool :
899
899
if isinstance (other , Model ):
900
- # TODO compare action dicts
901
- # if self.supports_actions():
902
- # actions_equal = sorted(self.actions.values()) == sorted(
903
- # other.actions.values()
904
- # )
905
- # else:
906
- # actions_equal = True
907
-
908
- # if not actions_equal:
909
- # print(self.actions,'\n', other.actions)
900
+ if self .supports_actions ():
901
+ assert self .actions is not None and other .actions is not None
902
+ for action , other_action in zip (
903
+ sorted (self .actions .values ()), sorted (other .actions .values ())
904
+ ):
905
+ if not action == other_action :
906
+ return False
910
907
return (
911
908
self .type == other .type
912
909
and self .states == other .states
913
910
and self .transitions == other .transitions
914
911
and sorted (self .rewards ) == sorted (other .rewards )
915
912
and self .exit_rates == other .exit_rates
916
913
and self .markovian_states == other .markovian_states
917
- # and actions_equal
918
914
)
919
915
return False
920
916
You can’t perform that action at this time.
0 commit comments