Class ail.Agent
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ail.Agent

Object
   |
   +----ail.Agent

public abstract class Agent
extends Object

Variable Index

 o allowOthersInArea
Does the agent like having other entities in the area
 o companionshipLevel
A factor that indicates the desire of a compatable companion
 o currentAge
Incremented each "turn"
 o currentHealthFactor
How healthy is the agent? This can be brought down by
 o currentHungerFactor
How hungry is the agent?
 o currentSize
How big is the agent?
 o currentSleepFactor
How sleep is the agent? Note that some agents may not sleep
 o dominantGender
This is the "mother" gender.
 o gender
Which gender this particular agent is.
 o leadershipLevel
Leadership level We could fold this into the dominant gender.
 o lengthOfLife
This is the life span of the agent.
 o levelOfSexuality
Returns the number of "mates" that are needed to successfully reproduce
 o maxHealthFactor
What is the highest state of health for the agent?
 o maxSize
What is the largest size this agent can be?
 o needFood
Does this agent need food to survive?
 o needResources
Does this agent need resources to survive?

Constructor Index

 o ail.Agent()
Default Constructor
 o ail.Agent(Agent[])
Optional constructor with parents chosen

Method Index

 o attack()
Attempts to initiate a method of attack to all "hostile" agents in the landscape Hostiles may be definied by isCompatible method, although, we may want same agent classes beating up on each other.
 o canInteract(Agent)
Can this agent interact with a particular agent? This will pretty much have to predefined using instanceof calls.
 o defend()
Called when an agent is forced to defend itself.
 o eat()
Eat this turn (based upon current location)
 o getInputs()
Each turn the agent can take in resources from the surrounding landscape.
 o getOutputs()
Each turn the agent can release resources.
 o grow()
When the agent is not fertile, it grows each "turn".
 o interact(Agent)
Called when a particular agent wishes to interact with another one
 o isAlive()
Allow for decomposition and resource reuse...
 o isCompatible(Agent)
This could be a cool concept.
 o isFertile()
Is the Agent currently in a fertile state of its lifespan?
 o move()
Move somewhere...
 o nextMove()
I envision this being called by the daemon process on each turn.
 o paint()
GUI-related - could be called draw() as well
 o reproduce()
Taking the current location and then reproducing.
 o sleep()
Sleep for this turn.

Variables

 o allowOthersInArea
public boolean allowOthersInArea
Does the agent like having other entities in the area

 o companionshipLevel
public int companionshipLevel
A factor that indicates the desire of a compatable companion

 o currentAge
public int currentAge
Incremented each "turn"

 o currentHealthFactor
public int currentHealthFactor
How healthy is the agent? This can be brought down by

 o currentHungerFactor
public int currentHungerFactor
How hungry is the agent?

 o currentSize
public int currentSize
How big is the agent?

See Also:
grow
 o currentSleepFactor
public int currentSleepFactor
How sleep is the agent? Note that some agents may not sleep

 o dominantGender
public int dominantGender
This is the "mother" gender. The children will be of this gender's class. We could do away with this by saying that the 0 gender is the "dominant" gender. Although, it could be cool if we make this part of the gene pool... =)

 o gender
public int gender
Which gender this particular agent is. Should be less than levelOfSexuality.

 o leadershipLevel
public int leadershipLevel
Leadership level We could fold this into the dominant gender. (i.e. Alpha females) A high leadership level in an agent means that other compatible agents are likely to follow the actions of this one.

 o lengthOfLife
public int lengthOfLife
This is the life span of the agent. Probably computed at spawn time (for our ease). The agent can still die due to hunger, death, etc.

 o levelOfSexuality
public int levelOfSexuality
Returns the number of "mates" that are needed to successfully reproduce

 o maxHealthFactor
public int maxHealthFactor
What is the highest state of health for the agent?

 o maxSize
public int maxSize
What is the largest size this agent can be?

 o needFood
public boolean needFood
Does this agent need food to survive?

 o needResources
public boolean needResources
Does this agent need resources to survive?

Constructors

 o Agent
public Agent()
Default Constructor

 o Agent
public Agent(Agent[] parents)
Optional constructor with parents chosen

Methods

 o attack
public abstract void attack()
Attempts to initiate a method of attack to all "hostile" agents in the landscape Hostiles may be definied by isCompatible method, although, we may want same agent classes beating up on each other. I believe that attacking and defense will be implemented much later on though.

 o canInteract
public abstract boolean canInteract(Agent a)
Can this agent interact with a particular agent? This will pretty much have to predefined using instanceof calls. (i.e. a bee and a plant mix for pollen...)

 o defend
public abstract void defend()
Called when an agent is forced to defend itself. Uses landscape to determine agents in area.

 o eat
public abstract void eat()
Eat this turn (based upon current location)

 o getInputs
public abstract ail.Resource getInputs()
Each turn the agent can take in resources from the surrounding landscape.

 o getOutputs
public abstract ail.Resource getOutputs()
Each turn the agent can release resources.

 o grow
public abstract void grow()
When the agent is not fertile, it grows each "turn". The agent can still perform another action in the same move.

 o interact
public abstract void interact(Agent a)
Called when a particular agent wishes to interact with another one

 o isAlive
public abstract boolean isAlive()
Allow for decomposition and resource reuse...

 o isCompatible
public abstract boolean isCompatible(Agent a)
This could be a cool concept. As I mentioned before, the DNA dictates the compatibility. Therefore, any Agents with "compatible" DNA can reproduce. For ease of use, any children are produdced by the dominant gender.

 o isFertile
public abstract boolean isFertile()
Is the Agent currently in a fertile state of its lifespan?

 o move
public abstract void move()
Move somewhere...

 o nextMove
public abstract void nextMove()
I envision this being called by the daemon process on each turn. This is responsible for determing what to do next.

 o paint
public abstract void paint()
GUI-related - could be called draw() as well

 o reproduce
public abstract ail.Agent[] reproduce()
Taking the current location and then reproducing. Yes, this function can probably be broken down as it is a bit vague...

 o sleep
public abstract void sleep()
Sleep for this turn.


All Packages  Class Hierarchy  This Package  Previous  Next  Index