|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--elge.agent.Agent | +--elge.agent.AgentContainer | +--elge.world.WorldAgent | +--elge.world.AbstractGenerator
The class is used a basic class for generator (or system agents). It defines some common things that the generator should have.
Field Summary | |
static int |
EXACT_GEN
generate on exact tick value |
static int |
FIRST_GEN
generate on first tick |
static String[] |
genCycleTypes
The names of the generation types |
static int |
NO_GEN
do not generate |
static int |
PERIOD_GEN
generate on a period |
static int |
TICK_GEN
generate on every tick |
Fields inherited from class elge.agent.AgentContainer |
agents, innerAgency |
Fields inherited from class elge.agent.Agent |
actualSituation, agency, agencyClass, agentClassCounter, id, name, registered |
Fields inherited from interface elge.world.MoveableAgent |
PROP_POSITION |
Constructor Summary | |
AbstractGenerator(String name)
Creates a new instance of AbstractGenerator |
Method Summary | |
protected abstract void |
agentAction()
define this method to generate, remove or whatevery you need to do. |
ComboInteger |
getGenCycleType()
Sets the cycle type of the generation. |
int |
getGenPeriod()
Returns the period in wich we should generate |
double |
getGenProb()
returns the generation probability |
int |
getInOneStep()
get the gen in one step value. |
protected void |
chooseAction()
we generate in chooseAction method. |
boolean |
isGenerator()
return true |
void |
setGenCycleType(ComboInteger i)
Sets the generation type |
void |
setGenPeriod(int period)
Sets the generation period if the cycle is of type 3, generating in period. |
void |
setGenProb(double prob)
Sets the probability of generating an agent.. |
void |
setInOneStep(int num)
How many agents to generate in one step.. |
Methods inherited from class elge.world.WorldAgent |
addVetoableChangeListener, getFullName, getGenerated, getGroup, getHidden, getPosition, paint, removeVetoableChangeListener, setGenerated, setGroup, setHidden, setPosition |
Methods inherited from class elge.agent.AgentContainer |
add, add, add, agentsLife, del, getAgentCount, getAgents, life, setAgents |
Methods inherited from class elge.agent.Agent |
ask, ask, ask, createDefaultAgency, createUniqueID, getAgency, getID, getName, init, life, memorize, restart, sense, setAgency, setAgency, setAgency, setID, setName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NO_GEN
public static final int FIRST_GEN
public static final int TICK_GEN
public static final int PERIOD_GEN
public static final int EXACT_GEN
public static final String[] genCycleTypes
Constructor Detail |
public AbstractGenerator(String name)
name
- The generator name.Method Detail |
public boolean isGenerator()
isGenerator
in class WorldAgent
public void setInOneStep(int num)
num
- number of objectspublic int getInOneStep()
public ComboInteger getGenCycleType()
public void setGenCycleType(ComboInteger i)
i
- the combo integer of the gen cycle type..getGenCycleType()
public void setGenProb(double prob)
prob
- the probabilitypublic double getGenProb()
public void setGenPeriod(int period)
period
- the periodpublic int getGenPeriod()
protected void chooseAction()
agentAction()
if
the generator should generate something...
chooseAction
in class Agent
protected abstract void agentAction()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |