massim.competition2011.scenario
Class ActionExecutor

java.lang.Object
  extended by massim.competition2011.scenario.ActionExecutor

public class ActionExecutor
extends java.lang.Object

This class in the one in charge of executing the agents actions.


Constructor Summary
ActionExecutor()
           
 
Method Summary
protected static void clearFlags(GraphSimulationWorldState world)
          Clears the information about the actions executed in the previous step.
static void execute(GraphSimulationWorldState world)
          Executes the actions of all agents.
protected static void executeAttacksAndParrys(GraphSimulationWorldState world)
          Executes all the attack actions simultaneously, meaning that all the costs calculations to corroborate that an attack can actually be performed, are made before updating the internal states of the attacked agents.
protected static void executeRest(GraphSimulationWorldState world)
          Executes the rest of the actions (excluding attacks) in a random order.
protected static boolean validAttack(GraphSimulationAgentState agent, GraphSimulationAgentState victim, GraphSimulationWorldState world)
          Returns true iff the victim is in the same node of the attacker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionExecutor

public ActionExecutor()
Method Detail

execute

public static void execute(GraphSimulationWorldState world)
Executes the actions of all agents.

Parameters:
world -

clearFlags

protected static void clearFlags(GraphSimulationWorldState world)
Clears the information about the actions executed in the previous step. Also determines random failure of actions.

Parameters:
world -

executeAttacksAndParrys

protected static void executeAttacksAndParrys(GraphSimulationWorldState world)
Executes all the attack actions simultaneously, meaning that all the costs calculations to corroborate that an attack can actually be performed, are made before updating the internal states of the attacked agents.

Parries are taking into account to determine the outcome of an attack, but the state of the parrying agents is not update regarding the parry action costs

Parameters:
world -

validAttack

protected static boolean validAttack(GraphSimulationAgentState agent,
                                     GraphSimulationAgentState victim,
                                     GraphSimulationWorldState world)
Returns true iff the victim is in the same node of the attacker.

Parameters:
agent -
victim -
world -
Returns:

executeRest

protected static void executeRest(GraphSimulationWorldState world)
Executes the rest of the actions (excluding attacks) in a random order. Random ordering can affect the outcome of the actions, for example when an agent is trying to repair another one that is trying to move to a different node, or when two agents in the same team attempt to buy and the team only has enough resources for one buy.

Parameters:
world -


Copyright © 2011. All Rights Reserved.