Package ora4mas.nopl
Class NormativeBoard
- java.lang.Object
-
- cartago.Artifact
-
- ora4mas.nopl.OrgArt
-
- ora4mas.nopl.NormativeBoard
-
- All Implemented Interfaces:
ToXML
,npl.DynamicFactsProvider
- Direct Known Subclasses:
LightNormativeBoard
public class NormativeBoard extends OrgArt
Artifact to manage a normative program (NPL)
Operations (see details in the methods list below):- load a NPL program
- addFact
- removeFact
- obligation(ag,reason,goal,deadline): current active obligations.
e.g.
obligation(bob,n4,committed(ag2,mBib,s1),1475417322254)
- Author:
- Jomi
- See Also:
SchemeBoard
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ora4mas.nopl.OrgArt
OrgArt.Ora4masWSPRuleEngine, OrgArt.UpdateGuiThread
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,npl.DynamicFactsProvider>
dynProviders
protected java.util.logging.Logger
logger
protected static java.util.Collection<NormativeBoard>
normBoards
-
Fields inherited from class ora4mas.nopl.OrgArt
dfpListeners, gui, myNPLListener, nengine, oeId, orgBoardName, orgState, ownerAgent, running, runningDestroy, sglDestroyed, sglNormFailure, sglOblCreated, sglOblFulfilled, sglOblInactive, sglOblUnfulfilled, updateGUIThread
-
-
Constructor Summary
Constructors Constructor Description NormativeBoard()
-
Method Summary
Modifier and Type Method Description void
addFact(java.lang.String f)
java.util.Iterator<jason.asSemantics.Unifier>
consult(jason.asSyntax.Literal l, jason.asSemantics.Unifier u)
void
debug(java.lang.String kind)
void
destroy()
(package private) void
doSubscribeDFP(java.lang.String artName)
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
java.lang.String
getDebugText()
static java.util.Collection<NormativeBoard>
getNormativeBoards()
java.lang.String
getNPLSrc()
protected java.lang.String
getStyleSheetName()
void
init()
Initialises the normative artifactboolean
isRelevant(jason.asSyntax.PredicateIndicator pi)
void
load(java.lang.String nplProgram)
Loads a normative program(package private) void
removeFact(java.lang.String f)
(package private) void
updateDFP(java.lang.String id, npl.DynamicFactsProvider p)
-
Methods inherited from class ora4mas.nopl.OrgArt
agKilled, debug, fixAgName, fixOSFile, getArtId, getAsDot, getLogger, getNormativeEngine, getNormIdTerm, getNSTransformer, getOEId, getOpUserName, getParser, getStyleSheet, getTermsAsProlog, getTermsAsProlog, initNormativeEngine, initWspRuleEngine, installNormativeSignaler, isUserAllowed, notifyListeners, ora4masOperationTemplate, postReorgUpdates, setOrgBoardName, setOwner, specToStr, subscribeDFP, updateGuiOE
-
Methods inherited from class cartago.Artifact
await, await, await_time, beginExtSession, commit, defineNewOp, defineObsProperty, defineOp, delay, dispose, dispose, endExtSession, endExtSessionWithFailure, execInternalOp, execLinkedOp, execLinkedOp, failed, failed, getCreatorId, getCurrentOpAgentBody, getCurrentOpAgentId, getId, getLinkedArtifacts, getManualSrcFile, getObservabilityRadius, getObsProperty, getObsPropertyByTemplate, getOpKey, getPosition, hasObsProperty, hasObsPropertyByTemplate, isLinked, log, lookupArtifact, makeArtifact, removeObsProperty, removeObsPropertyByTemplate, removeOp, setupOperations, setupPosition, signal, signal, updateObservabilityRadius, updateObsProperty, updatePosition
-
-
-
-
Field Detail
-
normBoards
protected static java.util.Collection<NormativeBoard> normBoards
-
dynProviders
protected java.util.Map<java.lang.String,npl.DynamicFactsProvider> dynProviders
-
logger
protected java.util.logging.Logger logger
-
-
Method Detail
-
getNormativeBoards
public static java.util.Collection<NormativeBoard> getNormativeBoards()
-
init
public void init()
Initialises the normative artifact
-
load
public void load(java.lang.String nplProgram) throws MoiseException, npl.parser.ParseException
Loads a normative program- Parameters:
nplProgram
- a string with the NPL program (or a file name)- Throws:
npl.parser.ParseException
- if the OS file is not correctMoiseException
- if schType was not specified
-
debug
public void debug(java.lang.String kind)
-
addFact
public void addFact(java.lang.String f) throws jason.asSyntax.parser.ParseException, npl.NormativeFailureException
- Throws:
jason.asSyntax.parser.ParseException
npl.NormativeFailureException
-
removeFact
void removeFact(java.lang.String f) throws jason.asSyntax.parser.ParseException, npl.NormativeFailureException
- Throws:
jason.asSyntax.parser.ParseException
npl.NormativeFailureException
-
updateDFP
void updateDFP(java.lang.String id, npl.DynamicFactsProvider p) throws npl.NormativeFailureException
- Throws:
npl.NormativeFailureException
-
doSubscribeDFP
void doSubscribeDFP(java.lang.String artName) throws cartago.OperationException
- Throws:
cartago.OperationException
-
getDebugText
public java.lang.String getDebugText()
- Overrides:
getDebugText
in classOrgArt
-
getStyleSheetName
protected java.lang.String getStyleSheetName()
- Specified by:
getStyleSheetName
in classOrgArt
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
-
isRelevant
public boolean isRelevant(jason.asSyntax.PredicateIndicator pi)
- Specified by:
isRelevant
in interfacenpl.DynamicFactsProvider
- Overrides:
isRelevant
in classOrgArt
-
-