feat: added reduce and connection logic
A rule still needs to be added to the inferred belief handles to prevent cyclical inferredBeliefs, but aside from that logic ifs finished. ref: N25B-433
This commit is contained in:
@@ -11,8 +11,8 @@ import {MultiConnectionHandle, SingleConnectionHandle} from "../components/RuleB
|
||||
import {allowOnlyConnectionsFromHandle, allowOnlyConnectionsFromType} from "../HandleRules.ts";
|
||||
import useFlowStore from '../VisProgStores';
|
||||
import { PlanReduce, type Plan } from '../components/Plan';
|
||||
import PlanEditorDialog from '../components/PlanEditor';
|
||||
import { BasicBeliefReduce } from './BasicBeliefNode.tsx';
|
||||
import PlanEditorDialog from '../components/PlanEditor';
|
||||
import {BeliefReduce} from "./BeliefReduce.ts";
|
||||
|
||||
/**
|
||||
* The default data structure for a Trigger node
|
||||
@@ -92,7 +92,7 @@ export default function TriggerNode(props: NodeProps<TriggerNode>) {
|
||||
export function TriggerReduce(node: Node, nodes: Node[]) {
|
||||
const data = node.data as TriggerNodeData;
|
||||
const conditionNode = data.condition ? nodes.find((n)=>n.id===data.condition) : undefined
|
||||
const conditionData = conditionNode ? BasicBeliefReduce(conditionNode, nodes) : ""
|
||||
const conditionData = conditionNode ? BeliefReduce(conditionNode, nodes) : ""
|
||||
return {
|
||||
id: node.id,
|
||||
condition: conditionData, // Make sure we have a condition before reducing, or default to ""
|
||||
|
||||
Reference in New Issue
Block a user