de.cesr.lara.components.decision.impl
Class LExplorationDeciderFactory<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>
java.lang.Object
de.cesr.lara.components.decision.impl.LExplorationDeciderFactory<A,BO>
- Type Parameters:
A
- type of agentBO
- type of behavioural option
- All Implemented Interfaces:
- LaraDeciderFactory<A,BO>
public class LExplorationDeciderFactory<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>
- extends Object
- implements LaraDeciderFactory<A,BO>
This decider factory creates a decider that just fetches the aagent's
preceding behavioural actions and chooses it as new action. TODO when the
model selector is able to define/alter the course of decision making, this
steps of the factory and decider might be omitted. However, it could be
useful to evaluate not only the last but the k last actions...
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getFactory
public static <A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>> LaraDeciderFactory<A,BO> getFactory(Class<A> clazz)
- The problem: In java, non-static class AgentT (parameter) cannot be
referenced from a static context, since there is only one class per class
no matter how many parameters it has. On the other hand, for a singleton
one needs to assure that it returns an instance of the requested
parameter. In order to prevent from instancing a map of
parameter-to-instance pairs we check if the current instance's parameter
is valid by comparing the class object and create a new instance if not.
In case of many agent classes the map approach might be more efficient.
For few agent classes it is unproblematic as long as agents of a certain
class are executed in line and different agent classes are not mixed to
often.
- Type Parameters:
A
- BO
- - Parameters:
clazz
-
- Returns:
- an instance of this factory
getDecider
public LaraDecider<BO> getDecider(A agent,
LaraDecisionConfiguration dConfiguration)
- Specified by:
getDecider
in interface LaraDeciderFactory<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>
- Returns:
- the valid
LaraDecider
- See Also:
LaraDeciderFactory.getDecider(de.cesr.lara.components.agents.LaraAgent,
de.cesr.lara.components.decision.LaraDecisionConfiguration)