diff --git a/src/App.js b/src/App.js index 375eb94..60ceae8 100644 --- a/src/App.js +++ b/src/App.js @@ -6,6 +6,7 @@ import AgentEventsPage from "./pages/AgentEventsPage"; import NavBar from "./component/NavBar"; import {useEffect, useState} from "react"; import PageLocation from "./component/PageLocation"; +import {Level} from "./model/Level"; function App() { const navigate = useNavigate(); @@ -42,8 +43,8 @@ function App() { }/> - }/> - }/> + }/> + }/> }/> diff --git a/src/component/ControlForm.js b/src/component/ControlForm.js index 427b40b..e990334 100644 --- a/src/component/ControlForm.js +++ b/src/component/ControlForm.js @@ -1,9 +1,19 @@ import React from "react"; import Form from 'react-bootstrap/Form'; import {Col} from "react-bootstrap"; +import {useLocation, useNavigate} from "react-router-dom"; +import {Level} from "../model/Level"; function ControlForm(props) { + const navigate = useNavigate(); + const location = useLocation() + function selectLevel(ev) { + const level = ev.target.value + navigate(location.pathname.replace(/[^/]*$/, level)) + props.selectLevel(level) + } + return ( @@ -22,9 +32,9 @@ function ControlForm(props) { Select the level: - props.selectLevel(e.target.value)}> - - + + + diff --git a/src/component/PageLocation.js b/src/component/PageLocation.js index f9bc694..0b89633 100644 --- a/src/component/PageLocation.js +++ b/src/component/PageLocation.js @@ -1,7 +1,7 @@ import Breadcrumb from 'react-bootstrap/Breadcrumb'; import {useLocation} from "react-router-dom"; -function PageLocation() { +function PageLocation(props) { const location = useLocation().pathname const pathname = location.split("/").filter(p => p).map(p => p.charAt(0).toUpperCase() + p.slice(1)) @@ -11,7 +11,7 @@ function PageLocation() { Home {pathname.map((path, idx) => ( - {path} + {path} ))} ); diff --git a/src/component/event/EventMapping.js b/src/component/event/EventMapping.js index 9b59c22..43230c4 100644 --- a/src/component/event/EventMapping.js +++ b/src/component/event/EventMapping.js @@ -1,67 +1,66 @@ -import PlanAdded from "./jason/planEvent/PlanAdded"; -import ExecutedDeed from "./jason/actionEvent/ExecutedDeed"; -import ExternalActionFinished from "./jason/actionEvent/ExternalActionFinished"; -import ExternalActionTriggered from "./jason/actionEvent/ExternalActionTriggered"; -import InternalActionFinished from "./jason/actionEvent/InternalActionFinished"; -import BeliefFromSrcAdded from "./jason/beliefEvent/BeliefFromSrcAdded"; -import BeliefAdded from "./jason/beliefEvent/BeliefAdded"; -import BeliefFromSrcRemoved from "./jason/beliefEvent/BeliefFromSrcRemoved"; -import BeliefRemoved from "./jason/beliefEvent/BeliefRemoved"; -import GoalCreated from "./jason/goalEvent/GoalCreated"; -import GoalRemoved from "./jason/goalEvent/GoalRemoved"; -import GoalSuspended from "./jason/goalEvent/GoalSuspended"; -import IntentionCreated from "./jason/intentionEvent/IntentionCreated"; -import IntentionRemoved from "./jason/intentionEvent/IntentionRemoved"; -import IntentionSuspended from "./jason/intentionEvent/IntentionSuspended"; -import IntentionUpdated from "./jason/intentionEvent/IntentionUpdated"; -import IntentionWaiting from "./jason/intentionEvent/IntentionWaiting"; -import NewPercept from "./jason/perceptEvent/NewPercept"; -import PlanRemoved from "./jason/planEvent/PlanRemoved"; -import SelectPlanEvent from "./jason/planEvent/SelectPlanEvent"; -import ReasoningCycleStarted from "./jason/reasoningCycleEvent/ReasoningCycleStarted"; -import NewAgentSignal from "./jason/signalEvent/NewAgentSignal"; -import NewArtifactSignal from "./jason/signalEvent/NewArtifactSignal"; -import MailBoxMessages from "./jason/speechActMessageEvent/MailBoxMessages"; -import NewSpeechActMessage from "./jason/speechActMessageEvent/NewSpeechActMessage"; -import SelectedMessage from "./jason/speechActMessageEvent/SelectedMessage"; -import SendMessage from "./jason/speechActMessageEvent/SendMessage"; -import PlanSelected from "./jason/goalEvent/PlanSelected"; -import NewDesire from "./bdi/NewDesire"; -import DesireCommitted from "./bdi/DesireCommitted"; -import DesireRemoved from "./bdi/DesireRemoved"; -import ExecutedAction from "./bdi/ExecutedAction"; -import BDIBeliefRemoved from "./bdi/BeliefRemoved"; -import NewBelief from "./bdi/NewBelief"; +import PlanAdded from "./implementation/planEvent/PlanAdded"; +import ExecutedDeed from "./implementation/actionEvent/ExecutedDeed"; +import ExternalActionFinished from "./implementation/actionEvent/ExternalActionFinished"; +import ExternalActionTriggered from "./implementation/actionEvent/ExternalActionTriggered"; +import InternalActionFinished from "./implementation/actionEvent/InternalActionFinished"; +import BeliefFromSrcAdded from "./implementation/beliefEvent/BeliefFromSrcAdded"; +import BeliefAdded from "./implementation/beliefEvent/BeliefAdded"; +import BeliefFromSrcRemoved from "./implementation/beliefEvent/BeliefFromSrcRemoved"; +import BeliefRemoved from "./implementation/beliefEvent/BeliefRemoved"; +import GoalCreated from "./implementation/goalEvent/GoalCreated"; +import GoalRemoved from "./implementation/goalEvent/GoalRemoved"; +import GoalSuspended from "./implementation/goalEvent/GoalSuspended"; +import IntentionCreated from "./implementation/intentionEvent/IntentionCreated"; +import IntentionRemoved from "./implementation/intentionEvent/IntentionRemoved"; +import IntentionSuspended from "./implementation/intentionEvent/IntentionSuspended"; +import IntentionUpdated from "./implementation/intentionEvent/IntentionUpdated"; +import IntentionWaiting from "./implementation/intentionEvent/IntentionWaiting"; +import NewPercept from "./implementation/perceptEvent/NewPercept"; +import PlanRemoved from "./implementation/planEvent/PlanRemoved"; +import SelectPlanEvent from "./implementation/planEvent/SelectPlanEvent"; +import ReasoningCycleStarted from "./implementation/reasoningCycleEvent/ReasoningCycleStarted"; +import NewAgentSignal from "./implementation/signalEvent/NewAgentSignal"; +import NewArtifactSignal from "./implementation/signalEvent/NewArtifactSignal"; +import MailBoxMessages from "./implementation/speechActMessageEvent/MailBoxMessages"; +import NewSpeechActMessage from "./implementation/speechActMessageEvent/NewSpeechActMessage"; +import SelectedMessage from "./implementation/speechActMessageEvent/SelectedMessage"; +import SendMessage from "./implementation/speechActMessageEvent/SendMessage"; +import PlanSelected from "./implementation/goalEvent/PlanSelected"; +import NewDesire from "./design/NewDesire"; +import DesireCommitted from "./design/DesireCommitted"; +import DesireRemoved from "./design/DesireRemoved"; +import ExecutedAction from "./design/ExecutedAction"; +import NewBelief from "./design/NewBelief"; const EventMapping = { - ExecutedDeed: {JASON: , BDI: }, - ExternalActionFinished: {JASON: , BDI: }, - ExternalActionTriggered: {JASON: , BDI: <>}, - InternalActionFinished: {JASON: , BDI: }, - BeliefAdded: {JASON: , BDI: }, - BeliefFromSrcAdded: {JASON: , BDI: <>}, - BeliefFromSrcRemoved: {JASON: , BDI: <>}, - BeliefRemoved: {JASON: , BDI: }, - GoalCreated: {JASON: , BDI: }, - GoalRemoved: {JASON: , BDI: }, - GoalSuspended: {JASON: , BDI: <>}, - PlanSelected: {JASON: , BDI: <>}, - IntentionCreated: {JASON: , BDI: <>}, - IntentionRemoved: {JASON: , BDI: <>}, - IntentionSuspended: {JASON: , BDI: <>}, - IntentionUpdated: {JASON: , BDI: <>}, - IntentionWaiting: {JASON: , BDI: <>}, - NewPercept: {JASON: , BDI: <>}, - PlanAdded: {JASON: , BDI: <>}, - PlanRemoved: {JASON: , BDI: <>}, - SelectPlanEvent: {JASON: , BDI: }, - ReasoningCycleStarted: {JASON: , BDI: <>}, - NewAgentSignal: {JASON: , BDI: <>}, - NewArtifactSignal: {JASON: , BDI: }, - MailBoxMessages: {JASON: , BDI: <>}, - NewSpeechActMessage: {JASON: , BDI: }, - SelectedMessage: {JASON: , BDI: <>}, - SendMessage: {JASON: , BDI: } + ExecutedDeed: {implementation: , design: }, + ExternalActionFinished: {implementation: , design: }, + ExternalActionTriggered: {implementation: , design: <>}, + InternalActionFinished: {implementation: , design: }, + BeliefAdded: {implementation: , design: }, + BeliefFromSrcAdded: {implementation: , design: <>}, + BeliefFromSrcRemoved: {implementation: , design: <>}, + BeliefRemoved: {implementation: , design: }, + GoalCreated: {implementation: , design: }, + GoalRemoved: {implementation: , design: }, + GoalSuspended: {implementation: , design: <>}, + PlanSelected: {implementation: , design: <>}, + IntentionCreated: {implementation: , design: <>}, + IntentionRemoved: {implementation: , design: <>}, + IntentionSuspended: {implementation: , design: <>}, + IntentionUpdated: {implementation: , design: <>}, + IntentionWaiting: {implementation: , design: <>}, + NewPercept: {implementation: , design: <>}, + PlanAdded: {implementation: , design: <>}, + PlanRemoved: {implementation: , design: <>}, + SelectPlanEvent: {implementation: , design: }, + ReasoningCycleStarted: {implementation: , design: <>}, + NewAgentSignal: {implementation: , design: <>}, + NewArtifactSignal: {implementation: , design: }, + MailBoxMessages: {implementation: , design: <>}, + NewSpeechActMessage: {implementation: , design: }, + SelectedMessage: {implementation: , design: <>}, + SendMessage: {implementation: , design: } }; export default EventMapping; \ No newline at end of file diff --git a/src/component/event/bdi/BeliefRemoved.js b/src/component/event/design/BeliefRemoved.js similarity index 100% rename from src/component/event/bdi/BeliefRemoved.js rename to src/component/event/design/BeliefRemoved.js diff --git a/src/component/event/bdi/DesireCommitted.js b/src/component/event/design/DesireCommitted.js similarity index 100% rename from src/component/event/bdi/DesireCommitted.js rename to src/component/event/design/DesireCommitted.js diff --git a/src/component/event/bdi/DesireRemoved.js b/src/component/event/design/DesireRemoved.js similarity index 100% rename from src/component/event/bdi/DesireRemoved.js rename to src/component/event/design/DesireRemoved.js diff --git a/src/component/event/bdi/ExecutedAction.js b/src/component/event/design/ExecutedAction.js similarity index 100% rename from src/component/event/bdi/ExecutedAction.js rename to src/component/event/design/ExecutedAction.js diff --git a/src/component/event/bdi/NewBelief.js b/src/component/event/design/NewBelief.js similarity index 100% rename from src/component/event/bdi/NewBelief.js rename to src/component/event/design/NewBelief.js diff --git a/src/component/event/bdi/NewDesire.js b/src/component/event/design/NewDesire.js similarity index 100% rename from src/component/event/bdi/NewDesire.js rename to src/component/event/design/NewDesire.js diff --git a/src/component/event/jason/actionEvent/ExecutedDeed.js b/src/component/event/implementation/actionEvent/ExecutedDeed.js similarity index 100% rename from src/component/event/jason/actionEvent/ExecutedDeed.js rename to src/component/event/implementation/actionEvent/ExecutedDeed.js diff --git a/src/component/event/jason/actionEvent/ExternalActionFinished.js b/src/component/event/implementation/actionEvent/ExternalActionFinished.js similarity index 100% rename from src/component/event/jason/actionEvent/ExternalActionFinished.js rename to src/component/event/implementation/actionEvent/ExternalActionFinished.js diff --git a/src/component/event/jason/actionEvent/ExternalActionTriggered.js b/src/component/event/implementation/actionEvent/ExternalActionTriggered.js similarity index 100% rename from src/component/event/jason/actionEvent/ExternalActionTriggered.js rename to src/component/event/implementation/actionEvent/ExternalActionTriggered.js diff --git a/src/component/event/jason/actionEvent/InternalActionFinished.js b/src/component/event/implementation/actionEvent/InternalActionFinished.js similarity index 100% rename from src/component/event/jason/actionEvent/InternalActionFinished.js rename to src/component/event/implementation/actionEvent/InternalActionFinished.js diff --git a/src/component/event/jason/beliefEvent/BeliefAdded.js b/src/component/event/implementation/beliefEvent/BeliefAdded.js similarity index 100% rename from src/component/event/jason/beliefEvent/BeliefAdded.js rename to src/component/event/implementation/beliefEvent/BeliefAdded.js diff --git a/src/component/event/jason/beliefEvent/BeliefFromSrcAdded.js b/src/component/event/implementation/beliefEvent/BeliefFromSrcAdded.js similarity index 100% rename from src/component/event/jason/beliefEvent/BeliefFromSrcAdded.js rename to src/component/event/implementation/beliefEvent/BeliefFromSrcAdded.js diff --git a/src/component/event/jason/beliefEvent/BeliefFromSrcRemoved.js b/src/component/event/implementation/beliefEvent/BeliefFromSrcRemoved.js similarity index 100% rename from src/component/event/jason/beliefEvent/BeliefFromSrcRemoved.js rename to src/component/event/implementation/beliefEvent/BeliefFromSrcRemoved.js diff --git a/src/component/event/jason/beliefEvent/BeliefRemoved.js b/src/component/event/implementation/beliefEvent/BeliefRemoved.js similarity index 100% rename from src/component/event/jason/beliefEvent/BeliefRemoved.js rename to src/component/event/implementation/beliefEvent/BeliefRemoved.js diff --git a/src/component/event/jason/goalEvent/GoalCreated.js b/src/component/event/implementation/goalEvent/GoalCreated.js similarity index 100% rename from src/component/event/jason/goalEvent/GoalCreated.js rename to src/component/event/implementation/goalEvent/GoalCreated.js diff --git a/src/component/event/jason/goalEvent/GoalRemoved.js b/src/component/event/implementation/goalEvent/GoalRemoved.js similarity index 100% rename from src/component/event/jason/goalEvent/GoalRemoved.js rename to src/component/event/implementation/goalEvent/GoalRemoved.js diff --git a/src/component/event/jason/goalEvent/GoalSuspended.js b/src/component/event/implementation/goalEvent/GoalSuspended.js similarity index 100% rename from src/component/event/jason/goalEvent/GoalSuspended.js rename to src/component/event/implementation/goalEvent/GoalSuspended.js diff --git a/src/component/event/jason/goalEvent/PlanSelected.js b/src/component/event/implementation/goalEvent/PlanSelected.js similarity index 100% rename from src/component/event/jason/goalEvent/PlanSelected.js rename to src/component/event/implementation/goalEvent/PlanSelected.js diff --git a/src/component/event/jason/intentionEvent/IntentionCreated.js b/src/component/event/implementation/intentionEvent/IntentionCreated.js similarity index 100% rename from src/component/event/jason/intentionEvent/IntentionCreated.js rename to src/component/event/implementation/intentionEvent/IntentionCreated.js diff --git a/src/component/event/jason/intentionEvent/IntentionRemoved.js b/src/component/event/implementation/intentionEvent/IntentionRemoved.js similarity index 100% rename from src/component/event/jason/intentionEvent/IntentionRemoved.js rename to src/component/event/implementation/intentionEvent/IntentionRemoved.js diff --git a/src/component/event/jason/intentionEvent/IntentionSuspended.js b/src/component/event/implementation/intentionEvent/IntentionSuspended.js similarity index 100% rename from src/component/event/jason/intentionEvent/IntentionSuspended.js rename to src/component/event/implementation/intentionEvent/IntentionSuspended.js diff --git a/src/component/event/jason/intentionEvent/IntentionUpdated.js b/src/component/event/implementation/intentionEvent/IntentionUpdated.js similarity index 100% rename from src/component/event/jason/intentionEvent/IntentionUpdated.js rename to src/component/event/implementation/intentionEvent/IntentionUpdated.js diff --git a/src/component/event/jason/intentionEvent/IntentionWaiting.js b/src/component/event/implementation/intentionEvent/IntentionWaiting.js similarity index 100% rename from src/component/event/jason/intentionEvent/IntentionWaiting.js rename to src/component/event/implementation/intentionEvent/IntentionWaiting.js diff --git a/src/component/event/jason/perceptEvent/NewPercept.js b/src/component/event/implementation/perceptEvent/NewPercept.js similarity index 100% rename from src/component/event/jason/perceptEvent/NewPercept.js rename to src/component/event/implementation/perceptEvent/NewPercept.js diff --git a/src/component/event/jason/planEvent/PlanAdded.js b/src/component/event/implementation/planEvent/PlanAdded.js similarity index 100% rename from src/component/event/jason/planEvent/PlanAdded.js rename to src/component/event/implementation/planEvent/PlanAdded.js diff --git a/src/component/event/jason/planEvent/PlanRemoved.js b/src/component/event/implementation/planEvent/PlanRemoved.js similarity index 100% rename from src/component/event/jason/planEvent/PlanRemoved.js rename to src/component/event/implementation/planEvent/PlanRemoved.js diff --git a/src/component/event/jason/planEvent/SelectPlanEvent.js b/src/component/event/implementation/planEvent/SelectPlanEvent.js similarity index 100% rename from src/component/event/jason/planEvent/SelectPlanEvent.js rename to src/component/event/implementation/planEvent/SelectPlanEvent.js diff --git a/src/component/event/jason/reasoningCycleEvent/ReasoningCycleStarted.js b/src/component/event/implementation/reasoningCycleEvent/ReasoningCycleStarted.js similarity index 100% rename from src/component/event/jason/reasoningCycleEvent/ReasoningCycleStarted.js rename to src/component/event/implementation/reasoningCycleEvent/ReasoningCycleStarted.js diff --git a/src/component/event/jason/signalEvent/NewAgentSignal.js b/src/component/event/implementation/signalEvent/NewAgentSignal.js similarity index 100% rename from src/component/event/jason/signalEvent/NewAgentSignal.js rename to src/component/event/implementation/signalEvent/NewAgentSignal.js diff --git a/src/component/event/jason/signalEvent/NewArtifactSignal.js b/src/component/event/implementation/signalEvent/NewArtifactSignal.js similarity index 85% rename from src/component/event/jason/signalEvent/NewArtifactSignal.js rename to src/component/event/implementation/signalEvent/NewArtifactSignal.js index 8894b24..6720cfc 100644 --- a/src/component/event/jason/signalEvent/NewArtifactSignal.js +++ b/src/component/event/implementation/signalEvent/NewArtifactSignal.js @@ -1,9 +1,10 @@ import React from "react"; import Event from "../../Event"; import {agentState} from "../../../../model/agentState"; +import {Level} from "../../../../model/Level"; function NewArtifactSignal(props) { - if (props.level === "JASON") { + if (props.level === Level.IMPLEMENTATION) { return (