1 package cz.cuni.amis.pogamut.sposh.context; 2 3 import cz.cuni.amis.pogamut.sposh.executor.IAction; 4 import cz.cuni.amis.pogamut.sposh.executor.ISense; 5 6 /** 7 * This is the "original" context from which all others should be derived. 8 * Context is used in state primitives (i.e. {@link IAction} and{@link ISense}) 9 * to access "shared" info. This is the "basic version," there are other versions 10 * tailored with modules for other environments, such as {@link UT2004Context}. 11 * @author Honza 12 */ 13 public class Context<AGENT> implements IContext<AGENT> { 14 protected final String name; 15 protected final AGENT bot; 16 17 /** 18 * Create new context. 19 * @param name Name of context, can be used in logs and such. 20 * @param bot Class of the bot that this behaviour is serving. 21 * Used by sense and actions for gathering info and manipulation of the bot. 22 */ 23 protected Context(String name, AGENT bot) { 24 this.name = name; 25 this.bot = bot; 26 } 27 28 @Override 29 public AGENT getBot() { 30 return bot; 31 } 32 }