de.cesr.lara.components.agents
Interface LaraAgent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>

Type Parameters:
A - the agent type of the implementing class
BO - the type of behavioural options the implementing agent class works with
All Superinterfaces:
LaraAbstractEventSubscriber, LaraEventSubscriber
All Known Implementing Classes:
Agent, LAbstractAgent, MyAgent

public interface LaraAgent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>
extends LaraEventSubscriber

The class uses recursive generics since the LaraAgentComponent requires the type of agent. See Maurice, M. N. & Wadler, P. Java Generics and Collections O'Reilly Media, 2006, p. 133ff. See also http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.5 A Type parameter cannot be generic. Furthermore, one cannot define more than one type in one ActualTypeArgument (T). So one needs to workaround with two ActualTypeArguments declarations (S extends LaraAgent, T extends Interface). Agents also work with BOs that require (only) a super class of their (agent) class.


Method Summary
 String getAgentId()
          Get the custom agent id.
 LaraAgentComponent<A,BO> getLaraComp()
          Returns the LaraAgentComponent of this agent.
 
Methods inherited from interface de.cesr.lara.components.eventbus.LaraEventSubscriber
onEvent
 

Method Detail

getAgentId

String getAgentId()
Get the custom agent id.

Returns:
agent id string

getLaraComp

LaraAgentComponent<A,BO> getLaraComp()
Returns the LaraAgentComponent of this agent.

Returns:
component Lara agent component