Ejemplo n.º 1
0
 public ActionResult LoadFile(HttpPostedFileBase file)
 {
     InputParametersViewModel inputParameters = null;
     if (file.ContentLength > 0)
     {
         var fileName = Path.GetFileName(file.FileName);
         if (fileName != null)
         {
             _qapAntAlgorithm = (QapAntAlgorithm) _standartAlgorithmBuilder.GetAlgorithm<QapGraph>(1, 1, 100, 50);
             _qapAntAlgorithm.Calculate(new QapGraph().Load(file.InputStream, _qapAntAlgorithm.NAnts));
             Session["algorithm"] = _qapAntAlgorithm;
             inputParameters = new InputParametersViewModel
             {
                 PheromoneIncrement = _qapAntAlgorithm.PheromoneInc.ToString(),
                 ExtraPheromoneIncrement = _qapAntAlgorithm.ExtraPheromoneInc.ToString(),
                 AntsNumber = _qapAntAlgorithm.NAnts.ToString(),
                 NoUpdatesLimit = _qapAntAlgorithm.MaxIterationsNoChanges.ToString(),
                 IterationsNumber = _qapAntAlgorithm.MaxIterations.ToString()
             };
         }
     }
     return RedirectToAction("Index", inputParameters);
 }
Ejemplo n.º 2
0
 public ActionResult Index(InputParametersViewModel inputParametersViewModel)
 {
     return View();
 }