turtlekit.kernel
Class Patch

java.lang.Object
  extended by turtlekit.kernel.Patch

public final class Patch
extends java.lang.Object

The Patch class

Version:
1.2 20/3/2000
Author:
Fabien MICHEL

Constructor Summary
Patch(TurtleEnvironment w)
           
 
Method Summary
 void dropMark(java.lang.String markName, java.lang.Object value)
          Drop a mark on the patch
 java.awt.Color getColor()
           
 java.lang.Object getMark(java.lang.String markName)
          get a mark deposed on the patch
 Patch[] getNeighbors()
           
 Turtle[] getTurtles()
          returns the turtles who are on the patch
 double getVariableValue(java.lang.String VariableName)
          return the value of the corresponding variable
 void incrementPatchVariable(java.lang.String VariableName, double n)
          add n to the value of the corresponding patch variable
 boolean isMarkPresent(java.lang.String markName)
          tests if the corresponding mark is present on the patch (true or false)
 void setColor(java.awt.Color c)
           
 void setPatchVariable(java.lang.String VariableName, double n)
          set the value of the corresponding patch variable to n, use it with observers in the setup method for example
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Patch

public Patch(TurtleEnvironment w)
Method Detail

setPatchVariable

public final void setPatchVariable(java.lang.String VariableName,
                                   double n)
set the value of the corresponding patch variable to n, use it with observers in the setup method for example


incrementPatchVariable

public final void incrementPatchVariable(java.lang.String VariableName,
                                         double n)
add n to the value of the corresponding patch variable


getVariableValue

public final double getVariableValue(java.lang.String VariableName)
return the value of the corresponding variable


getColor

public final java.awt.Color getColor()

setColor

public final void setColor(java.awt.Color c)

dropMark

public final void dropMark(java.lang.String markName,
                           java.lang.Object value)
Drop a mark on the patch

Parameters:
markName: - mark name
value: - mark itself, can be any java object

getMark

public final java.lang.Object getMark(java.lang.String markName)
get a mark deposed on the patch

Returns:
the corresponding java object, null if not present

isMarkPresent

public final boolean isMarkPresent(java.lang.String markName)
tests if the corresponding mark is present on the patch (true or false)


getTurtles

public final Turtle[] getTurtles()
returns the turtles who are on the patch


getNeighbors

public final Patch[] getNeighbors()

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.