Inheritance: LeanEngine.Entity.EntityBase
Esempio n. 1
0
        public override bool Equals(object obj)
        {
            Plans another = obj as Plans;

            if (another == null)
            {
                return(false);
            }
            else
            {
                return(this.ID == another.ID);
            }
        }
Esempio n. 2
0
        public void SetUp()
        {
            itemCode = "RM_A";
            locFrom = null;
            locTo = "RM";

            engine = new Engine();
            container = new EngineContainer();
            flow = new Flow();
            item = new Item();
            itemFlow = new ItemFlow();
            ItemFlows = new List<ItemFlow>();
            invBalance = new InvBalance();
            invBalances = new List<InvBalance>();
            plans = new List<Plans>();
            demandChains = new List<DemandChain>();

            flow.Code = "Flow01";
            item.ItemCode = itemCode;
            flow.FlowStrategy = new FlowStrategy();
            flow.FlowStrategy.Strategy = Enumerators.Strategy.JIT;
            itemFlow.Flow = flow;
            itemFlow.Item = item;
            itemFlow.LocFrom = locFrom;
            itemFlow.LocTo = locTo;
            itemFlow.MaxInv = 0;
            itemFlow.SafeInv = 50;
            ItemFlows.Add(itemFlow);

            time = DateTime.Parse(DateTime.Now.AddHours(1).ToString("yyyy-MM-dd HH") + ":00");
            string[] winTimes = new string[] { "00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00",
                "10:00","11:00", "12:00","13:00", "14:00","15:00", "16:00","17:00", "18:00","19:00", "20:00","21:00", "22:00","23:00" };
            flow.FlowStrategy.MonWinTime = winTimes;
            flow.FlowStrategy.TueWinTime = winTimes;
            flow.FlowStrategy.WedWinTime = winTimes;
            flow.FlowStrategy.ThuWinTime = winTimes;
            flow.FlowStrategy.FriWinTime = winTimes;
            flow.FlowStrategy.SatWinTime = winTimes;
            flow.FlowStrategy.SunWinTime = winTimes;
            flow.WindowTime = time;
            flow.OrderTime = DateTime.Now;
            flow.NextOrderTime = null;
            flow.FlowStrategy.LeadTime = 0.5;

            invBalance.Item = item;
            invBalance.Loc = locTo;
            invBalance.Qty = 100;
            invBalances.Add(invBalance);

            //RCT:20
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now.AddDays(-1);
            plan.OrderedQty = 100;
            plan.FinishedQty = 80;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            //RCT:50
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now;
            plan.OrderedQty = 50;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            //RCT:30(Ignore)
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = time;
            plan.OrderedQty = 30;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            //ISS:120
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now;
            plan.OrderedQty = 120;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.ISS;
            plans.Add(plan);

            //ISS:500(Ignore)
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = time.AddHours(1);
            plan.OrderedQty = 500;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.ISS;
            plans.Add(plan);

            //ISS:450(Demand)
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = time;
            plan.OrderedQty = 450;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.ISS;
            plans.Add(plan);

            container.ItemFlows = ItemFlows;
            container.InvBalances = invBalances;
            container.Plans = plans;
            container.DemandChains = demandChains;
        }
Esempio n. 3
0
        public void SetUp()
        {
            itemCode = "RM_A";
            locFrom = null;
            locTo = "RM";

            engine = new Engine();
            container = new EngineContainer();
            flow = new Flow();
            item = new Item();
            itemFlow = new ItemFlow();
            ItemFlows = new List<ItemFlow>();
            invBalance = new InvBalance();
            invBalances = new List<InvBalance>();
            plans = new List<Plans>();

            flow.FlowStrategy = new FlowStrategy();
            flow.FlowStrategy.Strategy = Enumerators.Strategy.KB;
            itemFlow.Flow = flow;
            item.ItemCode = itemCode;
            itemFlow.Item = item;
            itemFlow.LocFrom = locFrom;
            itemFlow.LocTo = locTo;
            itemFlow.MaxInv = 400;
            itemFlow.SafeInv = 200;
            itemFlow.UC = 50;
            ItemFlows.Add(itemFlow);

            string[] winTimes = new string[] { "11:00" };
            flow.FlowStrategy.MonWinTime = winTimes;
            flow.FlowStrategy.TueWinTime = winTimes;
            flow.FlowStrategy.WedWinTime = winTimes;
            flow.FlowStrategy.ThuWinTime = winTimes;
            flow.FlowStrategy.FriWinTime = winTimes;
            flow.FlowStrategy.SatWinTime = winTimes;
            flow.FlowStrategy.SunWinTime = winTimes;
            flow.WindowTime = DateTime.Parse(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 11:00");
            flow.NextOrderTime = null;

            invBalance.Item = item;
            invBalance.Loc = locTo;
            invBalance.Qty = 300;
            invBalances.Add(invBalance);

            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now.AddDays(-1);
            plan.OrderedQty = 100;
            plan.FinishedQty = 80;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now;
            plan.OrderedQty = 50;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now.AddDays(2);
            plan.OrderedQty = 500;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now;
            plan.OrderedQty = 500;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Plans;
            plan.IRType = Enumerators.IRType.RCT;
            plans.Add(plan);

            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.ReqTime = DateTime.Now;
            plan.OrderedQty = 450;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.ISS;
            plans.Add(plan);

            container.ItemFlows = ItemFlows;
            container.InvBalances = invBalances;
            container.Plans = plans;
        }
Esempio n. 4
0
        public void Test_FreeValue1()
        {
            //ISS:450(Demand),FreeValue1
            plan = new Plans();
            plan.Loc = locTo;
            plan.Item = item;
            plan.Item.FreeValue1 = "freevalue1";//FreeValue1
            plan.ReqTime = time;
            plan.OrderedQty = 50;
            plan.FinishedQty = 0;
            plan.PlanType = Enumerators.PlanType.Orders;
            plan.IRType = Enumerators.IRType.ISS;
            container.Plans.Add(plan);

            engine.TellMeDemands(container);
            //original 420, add freevalue1 50, then 470
            Assert.AreEqual(470, itemFlow.ReqQty);
        }