diff --git a/src/component/event/design/BeliefRemoved.js b/src/component/event/design/BeliefRemoved.js index 5cf3b3b..4da215b 100644 --- a/src/component/event/design/BeliefRemoved.js +++ b/src/component/event/design/BeliefRemoved.js @@ -17,7 +17,7 @@ function BDIBeliefRemoved(props) { if (intention) { const intentionInfo = intention.message.event.intentionInfo - reason = " because of intention " + intentionInfo.id + " " + intentionInfo.intendedMeansInfo[0].trigger + reason = " because of intention int-" + intentionInfo.id + "-" + intentionInfo.intendedMeansInfo[0].trigger explanation = props.log.slice(0, props.log.indexOf(props.event)).findLast(e => e.message.type === "GoalCreated" && e.message.event.goalInfo.intention.value && e.message.event.goalInfo.intention.value.id === intentionInfo.id) } diff --git a/src/component/event/design/DesireCommitted.js b/src/component/event/design/DesireCommitted.js index 8a22adb..cdfea0d 100644 --- a/src/component/event/design/DesireCommitted.js +++ b/src/component/event/design/DesireCommitted.js @@ -19,10 +19,10 @@ function DesireCommitted(props) { const context = selectedPlan.context ? " because I believe " + selectedPlan.context.replace("&", "and").replace("|", "or") : "" const body = selectedPlan.body ? "Plan body: " + selectedPlan.body : "" const id = intention.intentionInfo.id - const description = "I committed to desire " + desire + context + ", and it became a new intention " + id + " " + intention.intentionInfo.trigger + const description = "I committed to desire " + desire + context + ", and it became a new intention int-" + id + "-" + intention.intentionInfo.trigger let reason = getIntentionReason(desire, intention.intentionInfo) - let parentDesire = reason ? ["Intention " + id + " " + desire + " is an intention " + reason,
] : [] + let parentDesire = reason ? ["Intention int-" + id + "-" + desire + " is an intention " + reason,
] : [] if (agentState.intention[id]) { agentState.intention[id].push(desire) diff --git a/src/component/event/design/DesireRemoved.js b/src/component/event/design/DesireRemoved.js index c8a4d7c..1a960e3 100644 --- a/src/component/event/design/DesireRemoved.js +++ b/src/component/event/design/DesireRemoved.js @@ -22,13 +22,13 @@ function DesireRemoved(props) { if (im.length > 0) { let reason = getIntentionReason(functor, intention) - parentDesire = reason ? ["Intention " + id + " " + functor + " is an intention" + reason,
] : [] + parentDesire = reason ? ["Intention int-" + id + "-" + functor + " is an intention" + reason,
] : [] } } else { id = Object.keys(agentState.intention).find(key => agentState.intention[key].includes(functor)) } - let intentionInfo = "intention " + id + " " + functor.split('(')[0] + let intentionInfo = "intention int-" + id + "-" + functor.split('(')[0] if (result === "achieved") { type = "Desire satisfied"; description = "I have satisfied my desire " + functor + " because its " + intentionInfo + " finished" diff --git a/src/component/event/design/ExecutedAction.js b/src/component/event/design/ExecutedAction.js index 8c3a8b9..6b3bd90 100644 --- a/src/component/event/design/ExecutedAction.js +++ b/src/component/event/design/ExecutedAction.js @@ -38,7 +38,7 @@ function ExecutedAction(props) { break; } - const intention = "intention " + intentionId + " " + intentionTrigger.plan.trigger + const intention = "intention int-" + intentionId + "-" + intentionTrigger.plan.trigger description = description + deed.term + " because of " + intention info = info + deed.type diff --git a/src/component/event/implementation/actionEvent/ExternalActionFinished.js b/src/component/event/implementation/actionEvent/ExternalActionFinished.js index 7b89bcf..918d4ca 100644 --- a/src/component/event/implementation/actionEvent/ExternalActionFinished.js +++ b/src/component/event/implementation/actionEvent/ExternalActionFinished.js @@ -8,7 +8,7 @@ function ExternalActionFinished(props) { const type = "External Action Finished" let description = "External action " + deed.term + " executed" const explanation = props.log.slice(0, props.log.indexOf(props.event)).findLast(e => e.message.type === "GoalCreated" && intention && e.message.event.goalInfo.intention.value && e.message.event.goalInfo.intention.value.id === intention.id) - const info = "Type: external " + deed.type + (intention ? ", Intention: " + intention.id + " " + intention.trigger : "") + const info = "Type: external " + deed.type + (intention ? ", Intention: int-" + intention.id + "-" + intention.trigger : "") return (
diff --git a/src/component/event/implementation/actionEvent/ExternalActionTriggered.js b/src/component/event/implementation/actionEvent/ExternalActionTriggered.js index 2acb1b3..924377c 100644 --- a/src/component/event/implementation/actionEvent/ExternalActionTriggered.js +++ b/src/component/event/implementation/actionEvent/ExternalActionTriggered.js @@ -8,7 +8,7 @@ function ExternalActionTriggered(props) { const intention = props.event.message.event.action.intention let description = "External action " + deed.term + " triggered" const explanation = props.log.slice(0, props.log.indexOf(props.event)).findLast(e => e.message.type === "GoalCreated" && intention && e.message.event.goalInfo.intention.value && e.message.event.goalInfo.intention.value.id === intention.id) - const info = "Type: external action" + (intention ? ", Intention: " + intention.id + " " + intention.trigger : "") + const info = "Type: external action" + (intention ? ", Intention: int-" + intention.id + "-" + intention.trigger : "") return (
diff --git a/src/component/event/implementation/actionEvent/InternalActionFinished.js b/src/component/event/implementation/actionEvent/InternalActionFinished.js index f49d97f..623f107 100644 --- a/src/component/event/implementation/actionEvent/InternalActionFinished.js +++ b/src/component/event/implementation/actionEvent/InternalActionFinished.js @@ -8,7 +8,7 @@ function InternalActionFinished(props) { const intention = props.event.message.event.intentionInfo.value let description = "Internal action " + action.term + " finished" const explanation = props.log.slice(0, props.log.indexOf(props.event)).findLast(e => e.message.type === "GoalCreated" && intention && e.message.event.goalInfo.goalFunctor === intention.trigger) - const info = "Type: " + action.type + (intention ? ", Intention: " + intention.id + " " + intention.trigger : "") + const info = "Type: " + action.type + (intention ? ", Intention: int-" + intention.id + "-" + intention.trigger : "") return (
diff --git a/src/model/agentState.js b/src/model/agentState.js index 75c77b1..497a257 100644 --- a/src/model/agentState.js +++ b/src/model/agentState.js @@ -26,13 +26,13 @@ export function getIntentionReason(desire, intentionInfo) { } else if (agentState.speechAct.tell.includes(parent)) { reason = " created from " + parent + " message" } else if (agentState.speechAct.achieve.includes(parent)) { - reason = " created from intention " + id + " " + parent + reason = " created from intention int-" + id + "-" + parent } else if (agentState.belief.self.includes(parent)) { reason = " formed from the belief " + parent } else if (agentState.belief.percept.includes(parent)) { reason = " created from the perception of " + parent } else if (agentState.intention[id] && agentState.intention[id].includes(parent)) { - reason = " created from intention " + id + " " + parent + reason = " created from intention int-" + id + "-" + parent } }