## org.ascape.model.rule
Class ExecuteThenUpdate

    java.lang.Object
      org.ascape.model.AscapeObject
          org.ascape.model.rule.Rule
              org.ascape.model.rule.ExecuteThenUpdate

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, HasName, RandomFunctions

Direct Known Subclasses:
  Diffusion

    public abstract class ExecuteThenUpdate

extends Rule

A rule that should be executed in two phases; executing (calculating), and then updating. Assumes by rule execution, allowing for a form of by rule synchronous operation. (Please let me know if you can think of any reason why this might be useful in by agent execution.) See subclass Diffusion for the raison d'être of this class.

Since:
  1.0
Version:
  1.0
Author:
  Miles Parker
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.ascape.model.AscapeObject
`ARBITRARY_SEED, name, PLATFORM_DEFAULT_COLOR, scape`

Constructor Summary
`ExecuteThenUpdate()` Constructs an execute and update rule.
`ExecuteThenUpdate(java.lang.String name)` Constructs an execute and update rule with the provided name.

Method Summary
`abstract void` `execute(Agent agent)` Execute phase of the rule.
`abstract void` `update(Agent agent)` Execute update phase.

Methods inherited from class org.ascape.model.rule.Rule
`getScape, isCauseRemoval, isIterateAll, isRandomExecution, setScape`

Methods inherited from class org.ascape.model.AscapeObject
`clone, diffDeep, diffDeep, diffDeepBFS, diffDeepDFS, diffDeepValidate, diffDeepVisit, equalsDeep, equalsDeep, equalsDeep, getComparisonStream, getName, getRandom, getRandomSeed, randomInRange, randomInRange, randomIs, randomToLimit, reseed, setComparisonStream, setName, setRandom, setRandomSeed, toString`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ExecuteThenUpdate

    public ExecuteThenUpdate()

  Constructs an execute and update rule.

### ExecuteThenUpdate

    public ExecuteThenUpdate(java.lang.String name)

  Constructs an execute and update rule with the provided name. It is strongly encouraged to provide a name for all rules.

  Parameters:
    `name` - the name of this object

Method Detail

### execute

    public abstract void execute(Agent agent)

  Execute phase of the rule. Here you perform a calculation based on dependent values in other cells.

  Specified by:
    `execute` in class `Rule`
  Parameters:
    `agent` - the playing agent

### update

    public abstract void update(Agent agent)

  Execute update phase. Here you update the cell's values, after all cells have had there next step values calculated.

  Parameters:
    `agent` - the playing agent