org.ascape.model.rule
Class Diffusion

java.lang.Object
  extended by org.ascape.model.AscapeObject
      extended by org.ascape.model.rule.Rule
          extended by org.ascape.model.rule.ExecuteThenUpdate
              extended by org.ascape.model.rule.Diffusion
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HasName, RandomFunctions
Direct Known Subclasses:
ParameterizedDiffusion

public abstract class Diffusion
extends ExecuteThenUpdate

A rule causing some agent value to diffuse to its neighbors.

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

Field Summary
 
Fields inherited from class org.ascape.model.AscapeObject
ARBITRARY_SEED, name, scape
 
Constructor Summary
Diffusion(java.lang.String name)
          Constructs a diffusion rule with the provided name.
 
Method Summary
 void execute(Agent agent)
          Calculate and store diffusion value to neighbors.
abstract  double getDiffusionValue(Agent agent)
          Override with a call to the getter of the value to diffuse.
 boolean isRandomExecution()
          Does this action affect the state of any other agent in such a way that that another agent's execution of this rule would be affected? Used to determine safe optimization of iterations.
abstract  void setDiffusionValue(Agent agent, double value)
          Override with a call to the setter of the diffused value.
 void update(Agent agent)
          Update diffusion value.
 
Methods inherited from class org.ascape.model.rule.Rule
getScape, isCauseRemoval, isIterateAll, 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

Diffusion

public Diffusion(java.lang.String name)
Constructs a diffusion rule with the provided name.

Parameters:
name - the name of this object
Method Detail

getDiffusionValue

public abstract double getDiffusionValue(Agent agent)
Override with a call to the getter of the value to diffuse.

Parameters:
agent - the agent
Returns:
the diffusion value

setDiffusionValue

public abstract void setDiffusionValue(Agent agent,
                                       double value)
Override with a call to the setter of the diffused value.

Parameters:
agent - the agent
value - the value

execute

public void execute(Agent agent)
Calculate and store diffusion value to neighbors.

Specified by:
execute in class ExecuteThenUpdate
Parameters:
agent - the playing agent

update

public void update(Agent agent)
Update diffusion value. Occurs only when all diffusion has been calculated.

Specified by:
update in class ExecuteThenUpdate
Parameters:
agent - the agent

isRandomExecution

public boolean isRandomExecution()
Description copied from class: Rule
Does this action affect the state of any other agent in such a way that that another agent's execution of this rule would be affected? Used to determine safe optimization of iterations.

Overrides:
isRandomExecution in class Rule
Returns:
true, if is random execution


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.