History.HistoryView

public class HistoryView

Constructors

HistoryView

public HistoryView(int player)

Methods

getBirthLogs

public List<BirthLog> getBirthLogs(int stepNumber)

Return a list of BirthLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of BirthLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.

getCommandFeedback

public Map<Integer, ActionResult> getCommandFeedback(int playerNumber, int stepNumber)

Get a map of ActionResult objects covering unit ids mapped to their commands from agents controlling the specified playerNumber that the Model attempted to execute during the specified stepNumber. This returns null if the actions of that playerNumber are not visible to the player whose HistoryView this is. This happens only when fog of war (partial observability) is turned on, and only when the viewing player is not an observer. The actions in the list are a superset of the actions covered by CommandsIssued, as the model may use and generate feedback for commands issued during previous steps. The actions in the list are a superset of the actions whose primitive components are covered in PrmitiveFeedback, as some commands may be too flawed to lead to primitive components being calculated. The commands that the model attempts to execute will be included here even if they are primitive actions.

Parameters:
  • playerNumber – the player number whose commands this list is based on
  • stepNumber – the step number when the commands’ execution was attempted
Returns:

null if the playerNumber is not visible to the viewing player, a map of Integer unit ids to ActionResult objects corresponding the commands of the specified playerNumber that the Model attempted to execute during the specified stepNumber

getCommandsIssued

public Map<Integer, Action> getCommandsIssued(int playerNumber, int stepNumber)

Get a map of Action objects that were received by the Model during the specified stepNumber from agents controlling the specified playerNumber, mapped by the unit ids of the units the action This returns null if the actions of that playerNumber are not visible to the player whose HistoryView this is. This happens only when fog of war (partial observability) is turned on, and only when the viewing player is not an observer. The actions in the list are a subset of the actions covered by CommandFeedback, as the model may use and generate feedback for commands issued during previous steps.

Parameters:
  • playerNumber – the player number issuing commands
  • stepNumber – the step number when commands were issued
Returns:

null if the playerNumber is not visible to the viewing player, a list of Action objects received as commands during the specified stepNumber from agents controlling the specified playerNumber otherwise.

getDamageLogs

public List<DamageLog> getDamageLogs(int stepNumber)

Return a list of DamageLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of DamageLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.

getDeathLogs

public List<DeathLog> getDeathLogs(int stepNumber)

Return a list of DeathLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of DeathLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.

getPrimitiveFeedback

public Map<Integer, ActionResult> getPrimitiveFeedback(int playerNumber, int stepNumber)

Get a map of ActionResult objects that correspond to the unit ids mapped to primitive Actions attempted by the Model in resolving the commands issued by the specifed playerNumber during execution of the specified stepNumber. This returns null if the actions of that playerNumber are not visible to the player whose HistoryView this is. This happens only when fog of war (partial observability) is turned on, and only when the viewing player is not an observer. The primitive actions covered in these results are used to execute a (possibly non-strict) subset of the actions covered in the CommandResults for the same step, as some commands may be so flawed as to not correspond to any primitives. Primitive actions used to execute commands will be displayed here even if the command is a primitive action itself.

Parameters:
  • playerNumber – the player number whose feedback should be returned
  • stepNumber – the step number that the feedback occurred in.
Returns:

null if the playerNumber is not visible to the viewing player, a map of Integers (unit ids) to their ActionResult objects corresponding to the primitive Actions used during the specified stepNumber to execute the commands of the specified playerNumber otherwise.

getResourceDropoffLogs

public List<ResourceDropoffLog> getResourceDropoffLogs(int stepNumber)

Return a list of ResourceDropoffLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of ResourceDropoffLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.

getResourceNodeExhaustionLogs

public List<ResourceNodeExhaustionLog> getResourceNodeExhaustionLogs(int stepNumber)

Return a list of ResourceNodeExhaustionLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of ResourceNodeExhaustionLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.

getResourcePickupLogs

public List<ResourcePickupLog> getResourcePickupLogs(int stepNumber)

Return a list of ResourcePickupLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of ResourcePickupLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.

getRevealedResourceNodeLogs

public List<RevealedResourceNodeLog> getRevealedResourceNodeLogs()

Return a list of RevealedResourceNodeLog corresponding to events witnessed by this player.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of RevealedResourceNodeLog objects observed by the player whose HistoryView this is.

getUpgradeLogs

public List<UpgradeLog> getUpgradeLogs(int stepNumber)

Return a list of UpgradeLog corresponding to events witnessed by this player during the specified step.

Parameters:
  • stepNumber
Returns:

An unmodifiable list of UpgradeLog objects that occurred during the specified step and were observed by the player whose HistoryView this is.