/** * * @param owner * the owner (MentalState). * @param forAgent * the agent owning this database * @param type * the type of this database. If type is BASETYPE.KNOWLEDGEBASE, * this database will be assumed static * @param dbfs * the initial database formulas. If null, the initial database * is set empty. * @throws MSTDatabaseException */ protected SwiPrologMentalBase(MentalState owner, AgentId forAgent, BASETYPE type, List<DatabaseFormula> dbfs) throws MSTDatabaseException { super(owner, forAgent, type); try { this.database = (PrologDatabase) owner.getOwner().getKRInterface().getDatabase( owner.getAgentId() + ":" + forAgent + ":" + type, dbfs, type == BASETYPE.KNOWLEDGEBASE); this.owner.createdDatabase(this.database, type); } catch (KRDatabaseException e) { throw new MSTDatabaseException("could not create a database for '" + owner.getOwner() + "'.", e); } }
SwiPrologGoal(GoalBase owner, Update goal) throws MSTDatabaseException { super(owner.getOwner(), goal); try { this.database = (PrologDatabase) owner.getOwner().getOwner().getKRInterface().getDatabase( owner.getOwner().getAgentId() + ":" + owner.getName() + ":" + goal, goal.getAddList(), false); owner.getOwner().createdDatabase(this.database, BASETYPE.GOALBASE); } catch (KRDatabaseException e) { throw new MSTDatabaseException( "could not create a database for '" + goal + "' of '" + owner.getOwner().getOwner() + "'.", e); } }