/** * The update is removed from the beliefbase of the agent. * * @param update * The belief to be removed. * @param generator * the channel to report executed actions to . * @param agent * An optional agent to do the deletion (in a model) for; the current * agent is used otherwise. * @throws MSTDatabaseException * @throws MSTQueryException */ public List<Result> delete(Update update, ExecutionEventGeneratorInterface generator, AgentId... agent) throws MSTDatabaseException, MSTQueryException { generator.event(Channel.DELETE_START, update, update.getSourceInfo(), "delete %s", update); List<Result> result = this.mentalState.delete(update, agent); generator.event(Channel.DELETE_END, update, update.getSourceInfo(), "deleted %s", update); return result; }
/** * Goals in goal base associated with the agent that entail the given goal are * removed. * * @param update * The goal to be dropped. * @param agent * An optional agent to do the drop (in a model) for; the current * agent is used otherwise. * @throws MSTDatabaseException * @throws MSTQueryException */ public List<Result> drop(Update update, ExecutionEventGeneratorInterface generator, AgentId... agent) throws MSTDatabaseException, MSTQueryException { generator.event(Channel.DROP_START, update, update.getSourceInfo(), "drop %s", update); List<Result> dropped = this.mentalState.drop(update, agent); generator.event(Channel.DROP_END, update, update.getSourceInfo(), "dropped %s", update); return dropped; }
/** * The update is inserted into the belief base of the agent. * * @param update * The update to be inserted. * @param generator * the channel to report executed actions to . * @param agent * An optional agent to do the insertion (in a model) for; the * current agent is used otherwise. * @throws MSTDatabaseException * @throws MSTQueryException */ public List<Result> insert(Update update, ExecutionEventGeneratorInterface generator, AgentId... agent) throws MSTDatabaseException, MSTQueryException { generator.event(Channel.INSERT_START, update, update.getSourceInfo(), "insert %s", update); List<Result> result = this.mentalState.insert(update, agent); generator.event(Channel.INSERT_END, update, update.getSourceInfo(), "inserted %s", update); return result; }
/** * Goal is inserted in goal base associated with the agent, but only if goal is * not already present. * * @param update * The goal to be adopted. * @param focus * Indicates whether focus attention set should be used or not. * @param agent * An optional agent to do the adoption (in a model) for; the current * agent is used otherwise * @return success or failure. * @throws MSTDatabaseException * @throws MSTQueryException */ public List<Result> adopt(Update update, boolean focus, ExecutionEventGeneratorInterface generator, AgentId... agent) throws MSTDatabaseException, MSTQueryException { generator.event(Channel.ADOPT_START, update, update.getSourceInfo(), "adopt %s", update); List<Result> result = this.mentalState.adopt(update, focus, agent); generator.event(Channel.ADOPT_END, update, update.getSourceInfo(), "adopted %s", update); return result; }