Exemplo n.º 1
0
        public BottomLayerRunner(
            IParentLayerRunner parent,
            MonoBehaviour coroutineRunner,
            IBlackboardComponent blackboard,
            IPlannerDomain domain,
            byte layerIndex,
            float maxFScore,
            RawBlackboardArrayWrapper plannerDatasets,
            byte maxPlanLength)
        {
            Parent           = parent;
            _coroutineRunner = coroutineRunner;
            _blackboard      = blackboard;
            _domain          = domain;
            _layerIndex      = layerIndex;
            _maxFScore       = maxFScore;

            _plannerDatasets = plannerDatasets;
            _result.First    = new PlannerResult(maxPlanLength, Allocator.Persistent)
            {
                Count = 0
            };
            _result.Second = new PlannerResult(maxPlanLength, Allocator.Persistent)
            {
                Count = 0
            };
        }
Exemplo n.º 2
0
 public TaskRunner(HiraComponentContainer target, IBlackboardComponent blackboard, IPlannerDomain domain, Action <bool> onPlanRunnerFinished)
 {
     _domain               = domain;
     _target               = target;
     _blackboard           = blackboard;
     _executionQueue       = ExecutionQueue.Create();
     _serviceRunner        = ServiceRunner.Create();
     _onPlanRunnerFinished = onPlanRunnerFinished;
 }
Exemplo n.º 3
0
        private void Awake()
        {
            _planner = GetComponent <LayeredGoalOrientedActionPlanner>();
            if (_planner.InitializationStatus != InitializationState.Active)
            {
                Debug.LogError("Planner not initialized.");
                Destroy(this);
                return;
            }

            _domain             = _planner.Domain;
            _intermediateGoals  = new string[_domain.IntermediateLayerCount][];
            _activeGoalsIndices = new byte[_domain.IntermediateLayerCount];
            for (var i = 0; i < _activeGoalsIndices.Length; i++)
            {
                _activeGoalsIndices[i] = byte.MaxValue;
            }

            _planner.Debugger = this;
        }
Exemplo n.º 4
0
        public TopLayerRunner(
            MonoBehaviour coroutineRunner,
            IBlackboardComponent blackboard,
            IPlannerDomain domain,
            RawBlackboardArrayWrapper plannerDatasets)
        {
            _coroutineRunner = coroutineRunner;
            _blackboard      = blackboard;
            _domain          = domain;

            _plannerDatasets = plannerDatasets;
            _result.First    = new PlannerResult(1, Allocator.Persistent)
            {
                Count = 1, [0] = byte.MaxValue
            };
            _result.Second = new PlannerResult(1, Allocator.Persistent)
            {
                Count = 1, [0] = byte.MaxValue
            };
        }
Exemplo n.º 5
0
 private void OnDestroy()
 {
     _domain  = null;
     _planner = null;
 }