Ejemplo n.º 1
0
        // TODO: Should this go inside PlansLog class?
        public virtual float ActualPlanRunningTime(Agent agent, PlansLog plansLog)
        {
            // Find RootMapping of plansLog in the DeciderLog
            // TODO: Add chosenRootMapping to remove these lookups
            Mapping rootMapping = plansLog.allPlans[plansLog.chosenDriveType].rootMappings[plansLog.chosenPlanIndex];

            List <DeciderLog> deciderLogs = agentsDeciderLogs[agent].FindAll(
                x => x.currentMapping == rootMapping && (x.runType == DeciderRunType.FinishedMapping || x.runType == DeciderRunType.InterruptedMapping));

            //if (deciderLogs.Count > 1)
            //    Debug.LogError("Both Finished and Interrupted happened!!");

            if (deciderLogs.Count == 0)
            {
                return(-1f);
            }

            return(deciderLogs[0].time - plansLog.time);
        }
Ejemplo n.º 2
0
 public override float ActualPlanRunningTime(Agent agent, PlansLog plansLog)
 {
     return(0f);
 }