massim.cowsimulations
Class GridSimulationCell

java.lang.Object
  extended by massim.gridsimulations.AbstractGridSimulationCell
      extended by massim.cowsimulations.GridSimulationCell
All Implemented Interfaces:
java.io.Serializable

public class GridSimulationCell
extends AbstractGridSimulationCell

This class describes a single GridCell.

See Also:
Serialized Form

Field Summary
 java.lang.String agentTeam
           
 boolean canOpen
           
 boolean cow
           
 java.lang.String cowID
           
 int cowturn
           
 boolean fence
           
 boolean open
           
 boolean switcher
           
 
Fields inherited from class massim.gridsimulations.AbstractGridSimulationCell
agent, object, obstacle
 
Constructor Summary
GridSimulationCell()
           
 
Method Summary
 boolean freeCell()
          This method checks, if a cell is free to get in
 boolean freeCellforCow()
          This method checks, if a cell is free to get in
 boolean isStable1()
           
 boolean isStable2()
           
 boolean noObject()
          This method checks whether the cell contains an object or not.
 void setStable1(boolean stable1)
           
 void setStable2(boolean stable2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cow

public boolean cow

fence

public boolean fence

open

public boolean open

switcher

public boolean switcher

canOpen

public boolean canOpen

cowturn

public int cowturn

agentTeam

public java.lang.String agentTeam

cowID

public java.lang.String cowID
Constructor Detail

GridSimulationCell

public GridSimulationCell()
Method Detail

noObject

public boolean noObject()
This method checks whether the cell contains an object or not.

Specified by:
noObject in class AbstractGridSimulationCell
Returns:
Returns false, if cow, obstacle or agent is in the cell, otherwise true.

freeCell

public boolean freeCell()
This method checks, if a cell is free to get in

Specified by:
freeCell in class AbstractGridSimulationCell
Parameters:
x - Position x on the grid
y - Position y on the grid
Returns:
True in a such case, else false

freeCellforCow

public boolean freeCellforCow()
This method checks, if a cell is free to get in

Parameters:
x - Position x on the grid
y - Position y on the grid
Returns:
True in a such case, else false

setStable1

public void setStable1(boolean stable1)

isStable1

public boolean isStable1()

setStable2

public void setStable2(boolean stable2)

isStable2

public boolean isStable2()


Copyright © 2011. All Rights Reserved.