use of aima.core.learning.reinforcement.PerceptStateReward in project aima-java by aimacode.
the class ReinforcementAgent method execute.
@SuppressWarnings("unchecked")
@Override
public Action execute(Percept p) {
if (p instanceof PerceptStateReward<?>) {
Action a = execute((PerceptStateReward<S>) p);
if (null == a) {
a = NoOpAction.NO_OP;
setAlive(false);
}
return a;
}
throw new IllegalArgumentException("Percept passed in must be a PerceptStateReward");
}
Aggregations