public static void Main(string[] args) { MainMenu menu = new MainMenu(); SantasNiceList book = new SantasNiceList(); SantasToyBag bag = new SantasToyBag(); // Choice will hold the number entered by the user // after main menu ws displayed int choice; do { // Show the main menu choice = menu.Show(); var createChildAction = new CreateChild(); switch (choice) { // Menu option 1: creating children case 1: CreateChild.DoAction(book); break; // Menu option 2: add toy case 2: AddToy.DoAction(bag, book); break; // Menu option 2: add toy case 3: RevokeToy.DoAction(bag, book); break; } } while (choice <= 6); }
public static void Main(string[] args) { DatabaseInterface db = new DatabaseInterface("BAGOLOOT_DB"); db.CheckChildTable(); db.CheckToyTable(); MainMenu menu = new MainMenu(); ChildRegister book = new ChildRegister(db); ToyRegister bag = new ToyRegister(db); // Choice will hold the number entered by the user // after main menu ws displayed int choice; do { // Show the main menu choice = menu.Show(); switch (choice) { // Menu option 1: Adding child case 1: CreateChild.DoAction(book); break; // Menu option 2: Adding toy case 2: AddToy.DoAction(bag, book); break; } } while (choice != 3); }
private void CreateContractAgent(T_CustomerOrderPart orderPart) { _orderQueue.Enqueue(item: orderPart); DebugMessage(msg: $"Creating Contract Agent for order {orderPart.CustomerOrderId} with {orderPart.Article.Name} DueTime {orderPart.CustomerOrder.DueTime}"); var agentSetup = AgentSetup.Create(agent: this, behaviour: ContractAgent.Behaviour.Factory.Get(simType: _simulationType)); var instruction = CreateChild.Create(setup: agentSetup , target: ActorPaths.Guardians .Single(predicate: x => x.Key == GuardianType.Contract) .Value , source: this.Self); Send(instruction: instruction); }
/// <summary> /// Executing triggeredMethod ExecuteOn_BenchReady_Through_StartBench /// </summary> public static void ExecuteOn_BenchReady_Through_StartSimpleForkBench(XComponent.BenchSimpleFork.UserObject.StartSimpleForkBench startSimpleForkBench, object object_PublicMember, object object_InternalMember, Context context, IStartSimpleForkBenchStartSimpleForkBenchOnBenchReadyBenchManagerSenderInterface sender) { CreateChild child; //child = new CreateChild { IsFirst = true }; //sender.CreateChild(context, child); child = new CreateChild(); for (int i = 0; i < startSimpleForkBench.NbInstances - 1; i++) { sender.CreateChild(context, child); } child = new CreateChild { IsLast = true }; sender.CreateChild(context, child); TriggeredMethodContext.Instance.StartBench(); }
static void Main(string[] args) { var db = new DatabaseInterface("LootBag"); var BagOLoot = new MainMenu(); var book = new ChildrenRegister(db); var bag = new ToyRegister(db); int choice; do { choice = BagOLoot.Start(); switch (choice) { case 1: CreateChild.Action(book); break; case 2: AddToy.Action(bag, book); break; case 3: RevokeToy.Action(bag, book); break; case 4: ShowBag.Action(bag, book); break; case 5: DeliverToys.Action(book); break; case 6: YuletimeReport.Action(bag, book); break; } } while (choice != 7); }
internal void ResponseFromSystemForBom(M_Article article) { // Update var dueTime = _fArticle.DueTime; if (article.Operations != null) { dueTime = _fArticle.DueTime - article.Operations.Sum(selector: x => x.Duration + x.AverageTransitionDuration); } // TODO: Object that handles the different operations- current assumption is all operations are handled as a sequence (no alternative/parallel plans) _fArticle = _fArticle.UpdateCustomerOrderAndDue(id: _fArticle.CustomerOrderId, due: dueTime, storage: _fArticle.StorageAgent) .UpdateArticle(article: article); // Creates a Production Agent for each element that has to be produced for (var i = 0; i < _quantityToProduce; i++) { var agentSetup = AgentSetup.Create(agent: Agent, behaviour: ProductionAgent.Behaviour.Factory.Get(simType: SimulationType.None)); var instruction = CreateChild.Create(setup: agentSetup, target: ((IAgent)Agent).Guardian, source: Agent.Context.Self); Agent.Send(instruction: instruction); } }