No need to track did_fire, and no need to cancel reads since action will fire if we read the tokens.
@@ -131,22 +131,25 @@ def condition(action_input=[], action_output=[]):
#
action_result = action_result or ActionResult.empty_production()
- valid_production = action_result.did_fire and (tokens_produced == len(action_result.production))
+ valid_production = (tokens_produced == len(action_result.production))
- if action_result.did_fire and not valid_production:
+ if not valid_production:
#
# Error condition
#
action = "%s.%s" % (self._type, action_method.__name__)
raise Exception("%s invalid production %s, expected %s" % (action, str(action_result.production), str(tuple(action_output))))
- if not action_result.did_fire:
- #
- # No action performed => cancel the tentative read from the FIFOs
- #
- for portname in action_input:
- self.inports[portname].peek_cancel()
- else:
+ # if not action_result.did_fire:
+ # # We really shouldn't get here, ever.
+ # raise Exception("DID NOT FIRE")
+ # #
+ # # No action performed => cancel the tentative read from the FIFOs
+ # #
+ # for portname in action_input:
+ # self.inports[portname].peek_cancel()
+ # else:
+
#
# Action performed => commit to the read from the FIFOs
#
