Skip to content

Commit

Permalink
fix: new belief
Browse files Browse the repository at this point in the history
  • Loading branch information
yan-elena committed May 2, 2024
1 parent d77e404 commit 472596c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/component/event/design/NewBelief.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ function NewBelief(props) {
agentState.belief.self.push(functor)
break;
case "percept":
const percept = props.log.slice(props.log.indexOf(props.event)).find(e => e.message.type === "NewPercept" && e.message.event.perceptInfo.functor === belief).message.event.perceptInfo;
reason = " because I perceived it" + (percept.artifactName ? " from " + percept.artifactName : "")
info = percept.perceptType ? "Percept type: " + percept.perceptType : ""
agentState.belief.percept.push(functor)
const percept = props.log.slice(props.log.indexOf(props.event)).find(e => e.message.type === "NewPercept" && e.message.event.perceptInfo.functor === belief)
if (percept) {
const p = percept.message.event.perceptInfo;
reason = " because I perceived it" + (p.artifactName ? " from " + p.artifactName : "")
info = p.perceptType ? "Percept type: " + p.perceptType : ""
agentState.belief.percept.push(functor)
} else {
reason = ""
}
break;
case "":
reason = ""
Expand Down

0 comments on commit 472596c

Please sign in to comment.