Пример #1
0
    public GridNavigationTask(State t_startState, State t_goalState, float t_inflationFactor, ref List <State> t_path,
                              float t_tunnelDistanceThreshold, float t_tunnelTimeThreshold, ref List <State> t_spaceTimePath, GridTimeDomain t_gridTimeDomain,
                              TaskPriority t_taskPriority, TaskManager taskManager)
        : base(taskManager, t_taskPriority)          // defaults to a real-time task -- now what happens when both this and Global are first put in queue ??
    {
        taskType = TaskType.GridNavigationTask;

        startState = t_startState;
        goalState  = t_goalState;

        // EVENT : startState will trigger GridNavigationTask that STATE_CHANGED
        startState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // EVENT : goalState will trigger GridNavigationTask that STATE_CHANGED
        goalState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // EVENT : goalState will trigger GridNavigationTask that it is GOAL_INVALID or VALID
        goalState.registerObserver(Event.GOAL_INVALID, this);
        goalState.registerObserver(Event.GOAL_VALID, this);


        inflationFactor = t_inflationFactor;

        //planner = t_planner;
        outputPlan = new Dictionary <DefaultState, ARAstarNode>();
        path       = t_path;


        // TODO : deprecate these lists
        List <PlanningDomainBase> domainList    = new List <PlanningDomainBase>();
        ARAstarDomain             araStarDomain = new ARAstarDomain();

        araStarDomain.setPlanningTask(this);
        domainList.Add(araStarDomain);

        gridPlanner = new ARAstarPlanner();
        gridPlanner.init(ref domainList, 100);

        initialized = true;

        obstacleChanged     = false;
        obstacleChangedData = new List <object> ();


        // tunnel planner variables
        tunnelDistanceThreshold = t_tunnelDistanceThreshold;
        tunnelTimeThreshold     = t_tunnelTimeThreshold;
        gridTimeDomain          = t_gridTimeDomain;
        spaceTimePath           = t_spaceTimePath;

        spaceTimePathStatus = false;

        dynamicChange = false;

        currentlyExecutingTask = false;

        gridPathStatus = PathStatus.NoPath;
    }
Пример #2
0
    // defaults to a real-time task -- now what happens when both this and Global are first put in queue ??
    public GridNavigationTask(State t_startState, State t_goalState, float t_inflationFactor, ref List<State> t_path,
		float t_tunnelDistanceThreshold, float t_tunnelTimeThreshold, ref List<State> t_spaceTimePath, GridTimeDomain t_gridTimeDomain,
		TaskPriority t_taskPriority, TaskManager taskManager)
        : base(taskManager, t_taskPriority)
    {
        taskType = TaskType.GridNavigationTask;

        startState = t_startState;
        goalState = t_goalState;

        // EVENT : startState will trigger GridNavigationTask that STATE_CHANGED
        startState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // EVENT : goalState will trigger GridNavigationTask that STATE_CHANGED
        goalState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // EVENT : goalState will trigger GridNavigationTask that it is GOAL_INVALID or VALID
        goalState.registerObserver(Event.GOAL_INVALID, this);
        goalState.registerObserver(Event.GOAL_VALID, this);

        inflationFactor = t_inflationFactor;

        //planner = t_planner;
        outputPlan = new Dictionary<DefaultState, ARAstarNode>();
        path = t_path;

        // TODO : deprecate these lists
        List<PlanningDomainBase> domainList = new List<PlanningDomainBase>();
        ARAstarDomain araStarDomain = new ARAstarDomain ();
        araStarDomain.setPlanningTask(this);
        domainList.Add(araStarDomain);

        gridPlanner = new ARAstarPlanner();
        gridPlanner.init(ref domainList, 100);

        initialized = true;

        obstacleChanged = false;
        obstacleChangedData = new List<object> ();

        // tunnel planner variables
        tunnelDistanceThreshold = t_tunnelDistanceThreshold;
        tunnelTimeThreshold = t_tunnelTimeThreshold;
        gridTimeDomain = t_gridTimeDomain;
        spaceTimePath = t_spaceTimePath;

        spaceTimePathStatus = false;

        dynamicChange = false;

        currentlyExecutingTask = false;

        gridPathStatus = PathStatus.NoPath;
    }