|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjade.core.Agent
es.upv.dsic.gti_ia.jgomas.CJGomasAgent
es.upv.dsic.gti_ia.jgomas.CBasicTroop
public abstract class CBasicTroop
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jade.core.Agent |
---|
jade.core.Agent.Interrupted |
Field Summary | |
---|---|
static int |
ARG_TEAM
|
static int |
CLASS_ENGINEER
|
static int |
CLASS_FIELDOPS
|
static int |
CLASS_MEDIC
|
static int |
CLASS_NONE
|
static int |
CLASS_SOLDIER
|
protected CSight |
m_AimedAgent
Current aimed enemy |
protected Vector3D[] |
m_AStarPath
Array of points used in walking (a calculated) path task |
protected boolean |
m_bEscaping
Variable indicating if agent is escaping at this moment |
protected boolean |
m_bFighting
Variable indicating if agent is fighting at this moment |
protected boolean |
m_bObjectiveCarried
Variable indicating if this agent is carrying the objective pack (flag) |
protected Vector3D[] |
m_ControlPoints
Array of points used in patrolling task |
protected CTask |
m_CurrentTask
Variable used to point the current task in execution |
protected int |
m_eClass
|
protected int |
m_eTeam
|
protected java.util.ArrayList |
m_FOVObjects
List of objects in the agent's Field Of Vision |
protected int |
m_iAStarPathIndex
Current position in array m_AStarPath |
protected int |
m_iControlPointsIndex
Current position in array m_ControlPoints |
protected int |
m_iEngineersCount
|
protected int |
m_iFieldOpsCount
|
protected int |
m_iMedicsCount
|
protected int |
m_iSoldiersCount
|
protected int |
m_iTeamCount
|
protected jade.core.AID |
m_Manager
Variable used to store the AID of Manager |
protected CTerrainMap |
m_Map
Current Map |
protected CMobile |
m_Movement
Current position, direction, and so on... |
protected java.lang.String |
m_sAmmoService
|
protected java.lang.String |
m_sBackupService
|
protected java.lang.String |
m_sMedicService
|
protected java.util.Hashtable |
m_TaskList
List of prepared to execut tasks |
protected int[] |
m_TaskPriority
Array of default values of priorities for each task |
protected es.upv.dsic.gti_ia.jgomas.CThreshold |
m_Threshold
Limits of some variables (to trigger some events) |
protected static int |
MV_CANNOT_GET_POSITION
|
protected static int |
MV_NOT_MOVED_BY_TIME
|
protected static int |
MV_OK
|
static int |
TEAM_ALLIED
|
static int |
TEAM_AXIS
|
static int |
TEAM_NONE
|
protected static int |
TRANSITION_DEFAULT
|
protected static int |
TRANSITION_TO_FIGHTING
|
protected static int |
TRANSITION_TO_GOTO_TARGET
|
protected static int |
TRANSITION_TO_STANDING
|
protected static int |
TRANSITION_TO_TARGET_REACHED
|
Fields inherited from class es.upv.dsic.gti_ia.jgomas.CJGomasAgent |
---|
m_ID, m_ServiceList |
Fields inherited from class jade.core.Agent |
---|
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN |
Constructor Summary | |
---|---|
CBasicTroop()
|
Method Summary | |
---|---|
protected void |
AddServiceType(java.lang.String _sServiceType)
Adds a type of service to the service type list. |
protected void |
AddTask(int _tTypeOfTask,
jade.core.AID _Owner,
java.lang.String _sContent)
Adds a task to the task list. |
protected void |
AddTask(int _tTypeOfTask,
jade.core.AID _Owner,
java.lang.String _sContent,
int _iPriority)
Adds a task to the task list with a modified priority. |
protected void |
CallForAmmo()
Request for ammunition. |
protected void |
CallForBackup()
Request for backup. |
protected void |
CallForMedic()
Request for medicine. |
protected boolean |
CheckStaticPosition()
Checks our position on the static map. |
protected boolean |
CheckStaticPosition(double _x,
double _z)
Checks a position on the static map. |
protected void |
CreateControlPoints()
Calculates an array of positions for patrolling. |
protected void |
GenerateEscapePosition()
Calculates a new destiny position to escape. |
protected boolean |
GeneratePath()
Calculates a new destiny position to walk. |
protected boolean |
GetAgentToAim()
Calculates if there is an enemy at sight. |
protected int |
GetAmmo()
Get the current ammunition of the agent. |
protected int |
GetHealth()
Get the current health of the agent. |
protected int |
GetPower()
Get the current power of the agent. |
protected int |
GetStamina()
Get the current stamina of the agent. |
protected boolean |
HaveAgentToShot()
To know if an enemy is aimed. |
protected void |
Look()
The agent looks in the direction he is walking. |
protected int |
Move(long _dt)
|
protected void |
ObjectivePackTaken()
The agent has got the objective pack. |
protected void |
PerformAimAction()
Action to do when agent has an enemy at sight. |
protected void |
PerformInjuryAction()
Action to do when an agent is being shot. |
protected void |
PerformLookAction()
Action to do when the agent is looking at. |
protected void |
PerformNoAmmoAction()
Action to do if this agent cannot shoot. |
protected void |
PerformTargetReached(CTask _CurrentTask)
Action to do when this agent reaches the target of current task. |
protected void |
PerformThresholdAction()
Action to do when ammo or health values exceed the threshold allowed. |
protected void |
setup()
'setup' method of jade agents. |
protected void |
SetUpPriorities()
Definition of priorities for each kind of task. |
protected boolean |
Shot(int _iShotNum)
The agent shoots in the direction which he is aiming. |
protected boolean |
ShouldUpdateTargets()
Should we update now all 'prepared (to execute)' tasks? |
protected void |
takeDown()
'takeDown' method of jade agents. |
protected void |
UpdateTargets()
Update priority of all 'prepared (to execute)' tasks. |
protected void |
UsePower()
Use power from the power bar if possible (there is at least 25 units). |
protected void |
UseStamina()
Use stamina from the stamina bar if possible (there is at least 5 units). |
Methods inherited from class es.upv.dsic.gti_ia.jgomas.CJGomasAgent |
---|
AddService |
Methods inherited from class jade.core.Agent |
---|
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, getState, here, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setQueueSize, waitUntilStarted, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected jade.core.AID m_Manager
protected java.util.Hashtable m_TaskList
protected CTask m_CurrentTask
protected boolean m_bObjectiveCarried
protected int[] m_TaskPriority
protected Vector3D[] m_ControlPoints
protected int m_iControlPointsIndex
protected Vector3D[] m_AStarPath
protected int m_iAStarPathIndex
protected java.util.ArrayList m_FOVObjects
protected CSight m_AimedAgent
public static final int ARG_TEAM
public static final int TEAM_NONE
public static final int TEAM_ALLIED
public static final int TEAM_AXIS
public static final int CLASS_NONE
public static final int CLASS_SOLDIER
public static final int CLASS_MEDIC
public static final int CLASS_ENGINEER
public static final int CLASS_FIELDOPS
protected static final int TRANSITION_DEFAULT
protected static final int TRANSITION_TO_STANDING
protected static final int TRANSITION_TO_GOTO_TARGET
protected static final int TRANSITION_TO_TARGET_REACHED
protected static final int TRANSITION_TO_FIGHTING
protected static final int MV_OK
protected static final int MV_CANNOT_GET_POSITION
protected static final int MV_NOT_MOVED_BY_TIME
protected int m_eTeam
protected int m_eClass
protected boolean m_bFighting
protected boolean m_bEscaping
protected CMobile m_Movement
protected int m_iSoldiersCount
protected int m_iMedicsCount
protected int m_iEngineersCount
protected int m_iFieldOpsCount
protected int m_iTeamCount
protected es.upv.dsic.gti_ia.jgomas.CThreshold m_Threshold
protected CTerrainMap m_Map
protected java.lang.String m_sMedicService
protected java.lang.String m_sAmmoService
protected java.lang.String m_sBackupService
Constructor Detail |
---|
public CBasicTroop()
Method Detail |
---|
protected void setup()
setup
in class CJGomasAgent
protected void takeDown()
takeDown
in class CJGomasAgent
protected final int Move(long _dt)
protected final int GetHealth()
protected final int GetAmmo()
protected final int GetStamina()
protected final void UseStamina()
protected final int GetPower()
protected final void UsePower()
protected final void AddServiceType(java.lang.String _sServiceType)
_sServiceType
- protected final boolean CheckStaticPosition()
protected final boolean CheckStaticPosition(double _x, double _z)
_x
- _z
-
protected final void AddTask(int _tTypeOfTask, jade.core.AID _Owner, java.lang.String _sContent)
_tTypeOfTask
- one of the defined types of tasks._Owner
- the agent that induces the creation of the task._sContent
- is a position: ( x , y , z ) .protected final void AddTask(int _tTypeOfTask, jade.core.AID _Owner, java.lang.String _sContent, int _iPriority)
_tTypeOfTask
- one of the defined types of tasks._Owner
- the agent that induces the creation of the task._sContent
- is a position: ( x , y , z ) ._iPriority
- priority of taskprotected final void Look()
protected final boolean Shot(int _iShotNum)
_iShotNum
-
protected final void PerformAimAction()
protected final boolean HaveAgentToShot()
protected void CallForMedic()
protected void CallForAmmo()
protected void CallForBackup()
protected void UpdateTargets()
protected boolean ShouldUpdateTargets()
protected void ObjectivePackTaken()
protected void SetUpPriorities()
protected void PerformNoAmmoAction()
protected void PerformTargetReached(CTask _CurrentTask)
_CurrentTask
- protected void GenerateEscapePosition()
protected boolean GeneratePath()
protected void CreateControlPoints()
protected void PerformInjuryAction()
protected void PerformThresholdAction()
protected boolean GetAgentToAim()
protected void PerformLookAction()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |