Browse Source

more debugging

refactoring
sp 9 months ago
parent
commit
4ae274047f
  1. 3
      examples/shields/rl/utils.py

3
examples/shields/rl/utils.py

@ -123,7 +123,10 @@ class MiniGridShieldHandler(ShieldHandler):
for stateID in model.states:
choice = shield_scheduler.get_choice(stateID)
choices = choice.choice_map
state_valuation = state_valuations.get_string(stateID)
print(state_valuation)
print(choices)
ints = dict(re.findall(r'([a-zA-Z][_a-zA-Z0-9]+)=(-?[a-zA-Z0-9]+)', state_valuation))
booleans = re.findall(r'(\!?)([a-zA-Z][_a-zA-Z0-9]+)[\s\t]+', state_valuation)
booleans = {b[1]: False if b[0] == "!" else True for b in booleans}

Loading…
Cancel
Save