public void DeCacheIt() { Parser.path = @"D:\documents\frostbow\"; DecacheSteps(); UnityPlanningInterface.AddObservedNegativeConditions(UPC); var CausalMapFileName = GetCausalMapFileName(); var ThreatMapFileName = GetThreatMapFileName(); var EffortMapFileName = GetEffortDictFileName(); try { var cmap = BinarySerializer.DeSerializeObject <TupleMap <IPredicate, List <int> > >(CausalMapFileName + ".CachedCausalMap"); CacheMaps.CausalTupleMap = cmap; var tcmap = BinarySerializer.DeSerializeObject <TupleMap <IPredicate, List <int> > >(ThreatMapFileName + ".CachedThreatMap"); CacheMaps.ThreatTupleMap = tcmap; try { var emap = BinarySerializer.DeSerializeObject <TupleMap <IPredicate, int> >(EffortMapFileName + ".CachedEffortMap"); HeuristicMethods.visitedPreds = emap; } catch { CacheMaps.CacheAddReuseHeuristic(new State(UPC.initialPredicateList) as IState); UnityGroundActionFactory.PrimaryEffectHack(new State(UPC.initialPredicateList) as IState); } } catch { CacheMaps.CacheLinks(GroundActionFactory.GroundActions); CacheMaps.CacheGoalLinks(GroundActionFactory.GroundActions, UPC.goalPredicateList); CacheMaps.CacheAddReuseHeuristic(new State(UPC.initialPredicateList) as IState); UnityGroundActionFactory.PrimaryEffectHack(new State(UPC.initialPredicateList) as IState); } }
public void Awake() { planner = GameObject.FindGameObjectWithTag("Planner").GetComponent <UnityPlanningInterface>(); playableDirector = GetComponent <PlayableDirector>(); playableDirector.Stop(); }