cz.cuni.amis.pogamut.defcon.agentmanager
Class DefConAgentManager

Package class diagram package DefConAgentManager
java.lang.Object
  extended by cz.cuni.amis.pogamut.defcon.agentmanager.DefConAgentManager

public class DefConAgentManager
extends Object

This class is being used to instantiate new agents.

Author:
Radek 'Black_Hand' Pibil

Method Summary
<T extends DefConAgent<?>>
T
getAgentInstance(Class<? extends DefConAgentModule> cls)
          Instantiates a new agent from given module.
 DefConAgent getAgentInstance(String className)
          Simplified call to getAgentInstance(Class cls)
static DefConAgentManager getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DefConAgentManager getInstance()

getAgentInstance

public <T extends DefConAgent<?>> T getAgentInstance(Class<? extends DefConAgentModule> cls)
                                          throws CantInstantiateAgentException,
                                                 ModuleForAgentClassNotFoundException
Instantiates a new agent from given module.

Type Parameters:
T - Agent's super type (useful for simpler conversions).
Parameters:
cls - Module class.
Returns:
Instantiated agent.
Throws:
CantInstantiateAgentException - Instantiation failed.
ModuleForAgentClassNotFoundException - Module is null?

getAgentInstance

public DefConAgent getAgentInstance(String className)
                             throws CantInstantiateAgentException,
                                    ModuleForAgentClassNotFoundException
Simplified call to getAgentInstance(Class cls)

Parameters:
className - simple class name
Returns:
instantiated agent
Throws:
CantInstantiateAgentException - Instantiation failed.
ModuleForAgentClassNotFoundException - Module is null?


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.