26#include "../TaskSystem/TaskGraphTemplate.h"
27#include "../TaskSystem/LocalBlackboard.h"
103 std::vector<ValidationError>&
outErrors);
112 std::vector<ValidationError>&
outErrors);
165 const std::string& pinName);
ComponentTypeID GetComponentTypeID_Static()
Graph execution tracing for simulation and validation.
Simulates blueprint graph execution for validation purposes.
void TraceDataPinEvaluation(int32_t nodeId, const TaskGraphTemplate &tmpl, GraphExecutionTracer &tracer, int32_t depth=0)
Recursively traces data pin evaluation for pure data nodes.
int32_t GetNextNodeId(const TaskGraphTemplate &tmpl, int32_t nodeId, const std::string &pinName)
Gets the next node ID from an execution link.
std::set< int32_t > m_tracedDataNodes
Track data nodes already traced to prevent infinite recursion.
int32_t HandleWhileSimulation(const TaskGraphTemplate &tmpl, int32_t nodeId, LocalBlackboard &blackboard, GraphExecutionTracer &tracer)
Simulates a While loop execution.
void TraceDataConnection(int32_t sourceNodeId, const std::string &sourcePinName, int32_t targetNodeId, const std::string &targetPinName, const TaskGraphTemplate &tmpl, GraphExecutionTracer &tracer, int32_t depth)
Traces evaluation of a single data connection.
std::vector< int32_t > m_pathStack
Current execution path.
std::map< int32_t, int32_t > m_visitCount
Track visits per node to detect loops.
void BuildNodeReachabilityMap(const TaskGraphTemplate &tmpl, std::map< int32_t, bool > &reachable)
bool DetectPotentialInfiniteLoops(const TaskGraphTemplate &tmpl, std::vector< ValidationError > &outErrors)
Checks for potential infinite loops or cycles.
int32_t HandleSequenceSimulation(const TaskGraphTemplate &tmpl, int32_t nodeId, LocalBlackboard &blackboard, GraphExecutionTracer &tracer)
Simulates a Sequence node execution.
std::vector< ValidationError > SimulateExecution(const TaskGraphTemplate &tmpl, const SimulationOptions &options, GraphExecutionTracer &outTracer)
Simulates execution of a graph template.
int32_t SimulateStep(const TaskGraphTemplate &tmpl, int32_t currentNodeId, LocalBlackboard &blackboard, const SimulationOptions &options, GraphExecutionTracer &tracer)
int32_t HandleBranchSimulation(const TaskGraphTemplate &tmpl, int32_t nodeId, LocalBlackboard &blackboard, GraphExecutionTracer &tracer)
Simulates a Branch node execution.
bool ValidateAllBranches(const TaskGraphTemplate &tmpl, std::vector< ValidationError > &outErrors)
Validates all branch nodes in a graph.
int32_t HandleSwitchSimulation(const TaskGraphTemplate &tmpl, int32_t nodeId, LocalBlackboard &blackboard, GraphExecutionTracer &tracer)
Simulates a Switch node execution.
void MarkReachableNodes(const TaskGraphTemplate &tmpl, int32_t nodeId, std::map< int32_t, bool > &reachable)
GraphExecutionSimulator()
~GraphExecutionSimulator()
bool ValidateConditionExpression(int32_t nodeId, const std::string &expression)
Validates a condition expression.
bool ValidateDataConnections(const TaskGraphTemplate &tmpl, std::vector< ValidationError > &outErrors)
Validates all data connections in a graph.
std::vector< int32_t > FindUnreachableNodes(const TaskGraphTemplate &tmpl, std::vector< ValidationError > &outErrors)
Checks for unreachable nodes.
Records execution trace during graph simulation.
Simple map-based blackboard for task graph runtime state.
Immutable, shareable task graph asset.
< Provides AssetID and INVALID_ASSET_ID
Configuration options for graph simulation.
bool validateConditions
Check condition syntax.
int32_t maxStepsPerFrame
Maximum steps to prevent infinite loops.
bool validateDataFlow
Check data connections.
bool validateBranchPaths
Verify all branches lead somewhere.
std::string initialBlackboardJson
Optional initial blackboard values.
int32_t maxSubGraphDepth
Maximum nesting depth for subgraphs.