示例#1
0
      public void refillDesicionArchive(int CountEliteDecision, Random rand, Base_ACO algorithm)
      {
          Decision        bestDecision  = theArchive.getBestDecision();
          List <Decision> EliteDecision = theArchive.getEliteDicision(CountEliteDecision, rand);

          theArchive.refillArchive(bestDecision, EliteDecision, algorithm, theTerm, rand);
      }
示例#2
0
 public DecisionArchive(int decisionArchiveCount, Base_ACO algorithm)
 {
     Count = decisionArchiveCount;
     for (int i = 0; i < decisionArchiveCount; i++)
     {
         Decision the_decision = new Decision(algorithm);
         the_decisionArchive.Add(the_decision);
     }
     Weigths_backup = new double[Count];
 }
示例#3
0
 public Colony(int antCount, int decisionArchiveCount, int numTerm, Term Term, Base_ACO algorithm)
 {
     for (int i = 0; i < antCount; i++)
     {
         Ant the_Ant = new Ant();
         theAnts.Add(the_Ant);
     }
     theArchive = new DecisionArchive(decisionArchiveCount, algorithm);
     theTerm    = Term;
     parrent    = algorithm;
 }
示例#4
0
        public void makeNewDecision(Base_ACO algorithm, DecisionArchive archive, Random rand, double xi)
        {
            double [] sigma = calcSigma(archive, xi);

            decision = new Decision(algorithm);
            decision.TermOrWeghtClassParams.AddRange(archive[l].TermOrWeghtClassParams);
            for (int j = 0; j < archive[l].TermOrWeghtClassParams.Count; j++)
            {
                decision.TermOrWeghtClassParams[j] = Base_ACO.BoxMullerTransform(sigma[j], decision.TermOrWeghtClassParams[j], rand);
            }
        }
示例#5
0
 public void FillRandom(double [] Params, Random rand, bool is_rand = true)
 {
     for (int i = 0; i < Params.Count(); i++)
     {
         if (is_rand)
         {
             TermOrWeghtClassParams.Add(Base_ACO.BoxMullerTransform(0.1 * Params[i], Params[i], rand));
         }
         else
         {
             TermOrWeghtClassParams.Add(Params[i]);
         }
     }
 }
示例#6
0
 public Decision(Base_ACO algorithm)
 {
     TermOrWeghtClassParams = new List <double>();
     parrent = algorithm;
 }
示例#7
0
        public void refillArchive(Decision bestDecision, List <Decision> EliteDecision, Base_ACO algorithm, Term Term, Random rand)
        {
            int size = the_decisionArchive.Count;

            the_decisionArchive.Clear();
            the_decisionArchive.Add(bestDecision);
            the_decisionArchive.AddRange(EliteDecision);
            int countRandomSolution = size - EliteDecision.Count - 1;

            for (int i = 0; i < countRandomSolution; i++)
            {
                Decision the_decision = new Decision(algorithm);
                the_decisionArchive.Add(the_decision);

                the_decisionArchive[the_decisionArchive.Count - 1].FillRandom(Term.Parametrs, rand, true);

                the_decisionArchive[the_decisionArchive.Count - 1].CalcPecission(Term);
            }
            the_decisionArchive.Sort(new Decision.DecisionComparer());
        }