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);
        }
Exemple #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            GuardianType guardianType = db.GuardianType.Find(id);

            db.GuardianType.Remove(guardianType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #4
0
 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));
 }
Exemple #5
0
        public ActionResult Create([Bind(Include = "Id,Name")] GuardianType guardianType)
        {
            if (ModelState.IsValid)
            {
                db.GuardianType.Add(guardianType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(guardianType));
        }
Exemple #6
0
        // 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));
        }
Exemple #7
0
 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));
 }
Exemple #9
0
 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());
 }