public List <PlanningDetails> GetAllGridData(string planId) { var res = new List <PlanningDetails>(); var obj = new PlanningDetails(); var ds = new DataSet(); ds = _planningInfoDataService.GetAllGridData(planId); if (ds != null) { obj.WarpingInfo = (List <PlanningInfoDetailsWp1>)ListConversion.ConvertTo <PlanningInfoDetailsWp1>(ds.Tables[0]); obj.DyeingInfo = (List <PlanningInfoDetailsDye1>)ListConversion.ConvertTo <PlanningInfoDetailsDye1>(ds.Tables[1]); obj.WeavingInfo = (List <PlanningInfoDetailsWv1>)ListConversion.ConvertTo <PlanningInfoDetailsWv1>(ds.Tables[2]); res.Add(obj); } return(res); }
public void Plan(PlanningDetails details) { double priority = getPriority(details.currentState, details.nextState, details.action, details.reward); if (Math.Abs(priority) > 0.0001) { priorityQueue.Push(priority, details.CurrentStateAction); } for (int i = 0; i < details.cycleRate && !priorityQueue.IsEmpty(); i++) { StateAction currentStateAction = priorityQueue.Pop(); StateReward nextStateReward = details.model.GetStateReward(currentStateAction); if (nextStateReward != null) { StepDetails stepDetails; stepDetails.currentState = currentStateAction.state; stepDetails.action = currentStateAction.action; stepDetails.nextState = nextStateReward.state; stepDetails.reward = nextStateReward.reward; updateValues(stepDetails); } BackwardUpdatePriorityQueue(details.model, currentStateAction); } }