lib/demiurge/agent.rb
def allowed?
      # If the agent's busy state will clear this turn, this action
      # could happen.  We intentionally don't send a "disallowed"
      # notification for the action. It's not cancelled, nor is it
      # dispatched successfully. It's just waiting for a later tick to
      # do one of those two things.
      return false if @agent.state["busy"] > 1

      # A dilemma: if we cancel now when no actions are queued, then
      # any action queued this turn (e.g. from an
      # EveryXActionsIntention) won't be executed -- we said this
      # intention wasn't happening. If we *don't* return false in the
      # "allowed?" phase then we'll wind up sending out a cancel
      # notice every turn when there are no actions. So we add a
      # "silent" info option to the normal-every-turn cancellations,
      # but we *do* allow-then-cancel even in perfectly normal
      # circumstances.
      true
    end
# This action is allowed if the agent is not busy, or will become not-busy soon
This action is allowed if the agent is not busy, or will become not-busy soon
This action is allowed if the agent is not busy or will become not - busy soon
def allowed?
      return false if @agent.state["busy"] > 1
      true
    end
def allowed? return false if @agent . state [ "busy" ] > 1 true end
This action is allowed if the agent is not busy, or will become not-busy soon
This action is allowed if the agent is not busy or will become not - busy soon
# If the agent's busy state will clear this turn, this action # could happen.  We intentionally don't send a "disallowed" # notification for the action. It's not cancelled, nor is it # dispatched successfully. It's just waiting for a later tick to # do one of those two things. # A dilemma: if we cancel now when no actions are queued, then # any action queued this turn (e.g. from an # EveryXActionsIntention) won't be executed -- we said this # intention wasn't happening. If we *don't* return false in the # "allowed?" phase then we'll wind up sending out a cancel # notice every turn when there are no actions. So we add a # "silent" info option to the normal-every-turn cancellations, # but we *do* allow-then-cancel even in perfectly normal # circumstances.