crowdmodel.environment
Class CellObject

java.lang.Object
  extended by crowdmodel.CObject
      extended by crowdmodel.environment.CellObject

public class CellObject
extends CObject

Describes environmental objects and their location on the grid An object is always situated on one gridCell. Can be part of a larger object, however this is then a set cellObjects.

Author:
Nanda Wijermans

Field Summary
static int BAR
           
private  java.lang.String d_name
           
 boolean d_walkable
           
(package private)  int d_x
           
(package private)  int d_y
           
static int NOOBJECTS
           
static int POI
           
static int STAGE
           
static int TOILET
           
 
Fields inherited from class crowdmodel.CObject
d_id, d_world_context
 
Constructor Summary
CellObject(repast.simphony.context.Context<CObject> worldcontext, int x, int y, int id)
          Constructor of CellObject Creates the cell object
 
Method Summary
 java.lang.String getName()
          Returns the name-label of the cellObject
 boolean getWalkable()
          Returns whether the CellObject is walkable
 int getX()
          Returns the x-coordinate of the cellObject's position
 int getY()
          Returns the y-coordinate of the cellObject's position
 void setName(java.lang.String name)
          Sets the name-label of the cellObject
 void setValue()
          Sets the value of the cellObject in the valueLayer Where this value corresponds with the environment Object it belongs to as the valueLayer uses this value to visualise these objects on the display.
 void setValue(repast.simphony.context.Context<CObject> worldcontext)
          Sets the value of the cellObject in the valueLayer Where this value corresponds with the environment Object it belongs to as the valueLayer uses this value to visualise these objects on the display.
 void setWalkable(boolean walkable)
          Sets the CellObject as being walkable or not
 
Methods inherited from class crowdmodel.CObject
CObject, delete, getID, step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOOBJECTS

public static final int NOOBJECTS
See Also:
Constant Field Values

STAGE

public static final int STAGE
See Also:
Constant Field Values

BAR

public static final int BAR
See Also:
Constant Field Values

TOILET

public static final int TOILET
See Also:
Constant Field Values

POI

public static final int POI
See Also:
Constant Field Values

d_name

private java.lang.String d_name

d_walkable

public boolean d_walkable

d_x

final int d_x

d_y

final int d_y
Constructor Detail

CellObject

public CellObject(repast.simphony.context.Context<CObject> worldcontext,
                  int x,
                  int y,
                  int id)
Constructor of CellObject Creates the cell object

Method Detail

getX

public int getX()
Returns the x-coordinate of the cellObject's position


getY

public int getY()
Returns the y-coordinate of the cellObject's position


setName

public void setName(java.lang.String name)
Sets the name-label of the cellObject


getName

public java.lang.String getName()
Returns the name-label of the cellObject


setValue

public void setValue(repast.simphony.context.Context<CObject> worldcontext)
Sets the value of the cellObject in the valueLayer Where this value corresponds with the environment Object it belongs to as the valueLayer uses this value to visualise these objects on the display. NOTE: This setValue() is only used when the context is created. As the context doesn't exist yet is cannot be addressed by another class so the context is being passed as a parameter I do not prefer to use it this way, still finding a way to avoid using passing the context as a parameter


setValue

public void setValue()
Sets the value of the cellObject in the valueLayer Where this value corresponds with the environment Object it belongs to as the valueLayer uses this value to visualise these objects on the display.


setWalkable

public void setWalkable(boolean walkable)
Sets the CellObject as being walkable or not


getWalkable

public boolean getWalkable()
Returns whether the CellObject is walkable