massim.framework
Class ArrayAgentProvider

java.lang.Object
  extended by massim.framework.ArrayAgentProvider
All Implemented Interfaces:
AgentProvider, Component

public class ArrayAgentProvider
extends java.lang.Object
implements AgentProvider, Component

This class is able to serve as an AgentProvider. It will provide agents that were given to it by an array.


Constructor Summary
ArrayAgentProvider()
           
ArrayAgentProvider(UniqueSimulationAgent[] agents)
           
 
Method Summary
 void allocateAgent(UniqueSimulationAgent agent)
          Allocate an agent.
 void freeAgent(UniqueSimulationAgent agent)
          Free an agent
 UniqueSimulationAgent[] getAgents(AgentParameter agentparameter)
          Retrieve a list of available agents, fulfilling requirements as mentioned in agentparameter;
 void setAgents(UniqueSimulationAgent[] agents)
           
 void start()
          Tell the component to start activity.
 void stop()
          Tell the component to cease activity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayAgentProvider

public ArrayAgentProvider()

ArrayAgentProvider

public ArrayAgentProvider(UniqueSimulationAgent[] agents)
Method Detail

getAgents

public UniqueSimulationAgent[] getAgents(AgentParameter agentparameter)
Description copied from interface: AgentProvider
Retrieve a list of available agents, fulfilling requirements as mentioned in agentparameter;

Specified by:
getAgents in interface AgentProvider
Returns:
an array of suitable agents

setAgents

public void setAgents(UniqueSimulationAgent[] agents)

allocateAgent

public void allocateAgent(UniqueSimulationAgent agent)
Description copied from interface: AgentProvider
Allocate an agent. This means that it won't be offered anymore via getAgents until the agent is removed via it's remove method.

Specified by:
allocateAgent in interface AgentProvider
Parameters:
agent - to allocate.

freeAgent

public void freeAgent(UniqueSimulationAgent agent)
Description copied from interface: AgentProvider
Free an agent

Specified by:
freeAgent in interface AgentProvider

start

public void start()
Description copied from interface: Component
Tell the component to start activity.

Specified by:
start in interface Component

stop

public void stop()
Description copied from interface: Component
Tell the component to cease activity.

Specified by:
stop in interface Component


Copyright © 2012. All Rights Reserved.