コード例 #1
0
ファイル: ZenoTravelProblem.cs プロジェクト: otaTrunda/PADD
        public static ZenoTravelProblem loadFromSAS(Problem zenoTravelProblemInSAS)
        {
            ZenoTravelProblem res = new ZenoTravelProblem();

            res.load(zenoTravelProblemInSAS);
            res.preprocess();
            return(res);
        }
コード例 #2
0
        public override int solve(ZenoTravelProblem problem)
        {
            this.genomeLength = problem.nonBordedPersonsIDs.Count;
            this.geneMinVal   = problem.planesByIDs.Keys.Min();
            this.geneMaxVal   = problem.planesByIDs.Keys.Max();
            this.problem      = problem;

            var result = new int[0];

            if (problem.nonBordedPersonsIDs.Count > 0)
            {
                result = doLocalSearch();
            }

            var value = eval(result, returnPlan: true);

            //var value1 = eval(new int[] { 2, 2, 2 } , returnPlan: true);

            this.PDDL_plan = value.Item2;
            return(value.Item1);
        }
コード例 #3
0
 /// <summary>
 /// Returns length of a plan that solves the given problem.
 /// </summary>
 /// <param name=""></param>
 /// <returns></returns>
 public abstract int solve(ZenoTravelProblem problem);
コード例 #4
0
 public void showTravelGraph(ZenoTravelProblem problem, List <Person> onlyThesePersons = null)
 {
     singleSolver.showDeliveryGraph((onlyThesePersons == null ? problem.personsByIDs.Values.ToList() : onlyThesePersons), problem.planesByIDs.Values.First());
 }
コード例 #5
0
 public void setProblem(ZenoTravelProblem problem)
 {
     this.problem = problem;
 }
コード例 #6
0
 protected override void init()
 {
     this.p = ZenoTravelProblem.loadFromSAS(this.sasProblem);
 }