Exemplo n.º 1
0
 public Human(GENDER gender = GENDER.MALE, AGE age = AGE.BABY, GIRTH girth = GIRTH.SKINNY, CRIME crime = CRIME.NONE)
 {
     this.gender = gender;
     this.age    = age;
     this.girth  = girth;
     this.crime  = crime;
 }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            AGE aGE = db.AGEs.Find(id);

            db.AGEs.Remove(aGE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "idAge,imageAge,rangeAges")] AGE aGE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aGE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aGE));
 }
Exemplo n.º 4
0
 public Human CreateHuman(GENDER gender = GENDER.MALE, AGE age = AGE.BABY, GIRTH girth = GIRTH.SKINNY, CRIME crime = CRIME.NONE)
 {
     if (recycledHumans.Count == 0)
     {
         return(new Human(gender, age, girth, crime));
     }
     else
     {
         return(recycledHumans.Pop());
     }
 }
Exemplo n.º 5
0
        public ActionResult Create([Bind(Include = "idAge,imageAge,rangeAges")] AGE aGE)
        {
            if (ModelState.IsValid)
            {
                db.AGEs.Add(aGE);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aGE));
        }
Exemplo n.º 6
0
        //// GET: Ages/Edit/5
        //[Authorize(Roles = "admin")]
        //[Authorize(Roles = "manager")]
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AGE aGE = db.AGEs.Find(id);

            if (aGE == null)
            {
                return(HttpNotFound());
            }
            return(View(aGE));
        }
Exemplo n.º 7
0
 void Start()
 {
     journeyLength = 0;
     objani        = GetComponent <Animator>();
     InvokeRepeating("GettingHungry", 2f, 3f);
     InvokeRepeating("GettingDirty", 2f, 3f);
     InvokeRepeating("GettingOld", 2f, 5f);
     InvokeRepeating("HealthRegen", 2f, 8f);
     health_bar     = HP.GetComponent <Text>();
     cleaniness_bar = c.GetComponent <Text>();
     hunger_bar     = h.GetComponent <Text>();
     xp_bar         = xp.GetComponent <Text>();
     age_bar        = AGE.GetComponent <Text>();
     _event         = Event.GetComponent <Text>();
     strength_bar   = Strenght.GetComponent <Text>();
 }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Console.WriteLine("Introduzca semilla: ");
            int semilla = Console.ReadKey().KeyChar - 48;

            Console.WriteLine("Semilla: " + semilla);



            Random rand = new Random(semilla);



            Console.WriteLine("Introduzca el nombre de la base de datos a cargar (debe estar en el mismo directorio que el ejecutable): ");
            string ruta = "./" + Console.ReadLine();

            Console.WriteLine("Se ejecutarán todos los algoritmos para estos datos");


            AGG agg = new AGG(ruta, rand);

            Console.WriteLine("Coste AGG-Pos: " + agg.GetBestSolution().GetCoste());


            agg = new AGG(ruta, rand, true);
            Console.WriteLine("Coste AGG-Pmx: " + agg.GetBestSolution().GetCoste());


            AGE age = new AGE(ruta, rand);

            Console.WriteLine("Coste AGE-Pos: " + age.GetBestSolution().GetCoste());


            age = new AGE(ruta, rand, true);
            Console.WriteLine("Coste AGE-Pmx: " + age.GetBestSolution().GetCoste());


            AM am = new AM(ruta, rand, num_Cromosomas: 10);

            Console.WriteLine("Coste AM-10,1: " + am.GetBestSolution().GetCoste());

            am = new AM(ruta, rand, num_Cromosomas: 10, _porcentajeMeme: 0.1f);
            Console.WriteLine("Coste AM-10,0.1: " + am.GetBestSolution().GetCoste());

            am = new AM(ruta, rand, num_Cromosomas: 10, _porcentajeMeme: 0.1f, _mejorPorcentajeMeme: true);
            Console.WriteLine("Coste AM-10,0.1mej: " + am.GetBestSolution().GetCoste());
        }
Exemplo n.º 9
0
 public void SetAge(AGE age)
 {
     this.age = age;
 }