/// <summary> /// /// </summary> /// <param name="problemInstance"></param> /// <param name="minDepth"></param> /// <param name="runner"></param> /// <param name="minCost">Not taken into account</param> public virtual void Setup(ProblemInstance problemInstance, int minDepth, MAM_Run runner, int minCost = -1) { this.instance = problemInstance; this.runner = runner; this.ClearPrivateStatistics(); this.totalCost = 0; this.solutionDepth = -1; this.targetCost = int.MaxValue; this.lowLevelGeneratedCap = int.MaxValue; this.milliCap = int.MaxValue; this.goalNode = null; this.solution = null; this.maxCost = int.MaxValue; //this.topMost = this.SetGlobals(); this.minDepth = minDepth; CFMCbsNode root = new CFMCbsNode(instance.m_vAgents.Length, this); // Problem instance and various strategy data is all passed under 'this'. // Solve the root node - Solve with MMStar, and find conflicts bool solved = root.Solve(); if (solved && root.totalCost <= this.maxCost) { this.openList.Add(root); this.highLevelGenerated++; this.closedList.Add(root, root); } }
public virtual void Setup ( ProblemInstance problemInstance, MAM_Run runner ) { this.Setup(problemInstance, 0, runner); }
/// <summary> /// /// </summary> /// <param name="problemInstance"></param> /// <param name="minDepth"></param> /// <param name="runner"></param> /// <param name="minCost">Not taken into account</param> public virtual void Setup ( ProblemInstance problemInstance, int minDepth, MAM_Run runner, int minCost = -1, HashSet <MMStarConstraint> constraints = null ) { this.instance = problemInstance; this.runner = runner; this.ClearPrivateStatistics(); this.totalCost = 0; this.solutionDepth = -1; this.milliCap = int.MaxValue; this.goalLocation = null; this.solution = null; this.bestMakeSpanCost = int.MaxValue; this.bestSOCCost = int.MaxValue; this.bestCostLocation = null; this.meetFlag = false; this.success = false; this.openList = new MAM_OpenList(this); if (constraints != null) { this.constraints = constraints; } else { this.constraints = new HashSet <MMStarConstraint>(); } AddSubSetHeuristics(); foreach (MAM_AgentState agent in this.instance.m_vAgents) { agent.numOfAgentsInBestHeuristic = this.instance.m_vAgents.Length; CalculateH(agent, null); CalculateF(agent); closed(agent); openList.Add(agent); } }