private AgentMoc(ActorPaths actorPaths, long time, bool debug, IActorRef principal, IBehaviour behaviour, GuardianType guardianType) : base(actorPaths: actorPaths, time: time, debug: debug, principal: principal) { _actorPaths = actorPaths; _guardianType = guardianType; this.InitializeAgent(behaviour: behaviour); }
private void CreateGuard(GuardianType guardianType, GuardianBehaviour guardianBehaviour) { var guard = _simulation.ActorSystem.ActorOf(props: Guardian.Props(actorPaths: ActorPaths, time: 0, debug: _debugAgents), name: guardianType.ToString() + "Guard"); _simulation.SimulationContext.Tell(message: BasicInstruction.Initialize.Create(target: guard, message: guardianBehaviour)); ActorPaths.AddGuardian(guardianType: guardianType, actorRef: guard); }
public ActionResult DeleteConfirmed(int id) { GuardianType guardianType = db.GuardianType.Find(id); db.GuardianType.Remove(guardianType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] GuardianType guardianType) { if (ModelState.IsValid) { db.Entry(guardianType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(guardianType)); }
public ActionResult Create([Bind(Include = "Id,Name")] GuardianType guardianType) { if (ModelState.IsValid) { db.GuardianType.Add(guardianType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(guardianType)); }
// GET: GuardianTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GuardianType guardianType = db.GuardianType.Find(id); if (guardianType == null) { return(HttpNotFound()); } return(View(guardianType)); }
public void AddGuardian(GuardianType guardianType, IActorRef actorRef) { Guardians.Add(key: guardianType, value: actorRef); }
public static AgentMoc CreateAgent(ActorPaths actorPaths, IActorRef principal, IBehaviour behaviour, GuardianType guardianType) { return(new AgentMoc(actorPaths: actorPaths, time: 0, debug: false, principal: principal, behaviour: behaviour, guardianType: guardianType)); }
public static ioschools.DB.user ToParent(this ioschools.DB.user row, GuardianType type) { return(row.students_guardians.Where( x => x.type == (int)type).Select(x => x.user1) .FirstOrDefault()); }