Exemplo n.º 1
0
 public PSOAlgorithm<ICell[]> CreateFrequencyValueBased(int Population,FAPModel Model,double localCoefficient, double globalCoefficient)
 {
     PositionGenCellArray generator = new FrequencyPositionGenerator(Model);
     FitnessFuncCellArray evalFunction = new FAPCostFunction(Model);
     ParticleMoveFunction moveFunction = new ParticlePerTrxFunction(Model, Model.GeneralInformation.Spectrum[0], Model.GeneralInformation.Spectrum[1],
          localCoefficient, globalCoefficient, CreateCollisionResolver(Model));
     ICellIntegrityChecker checker = new GBCViolationChecker(Model.GeneralInformation.GloballyBlockedChannels);
     String benchName = Model.GeneralInformation.ScenarioID;
     return new FAPPSOAlgorithm(benchName,Population, evalFunction, moveFunction, generator, checker,GBestFactory.GetStandardSelector());
 }
Exemplo n.º 2
0
 public void RunSiemens4Test()
 {
     FAPModelFactory factory = new FAPModelFactory();
     Console.Write("Creating model siemens4 problem");
     FAPModel model = factory.CreateSiemens4Model();
     Console.WriteLine(" ... Done");
     Console.Write("Loading assignment for siemens4");
     model.LoadTestData(@"..\..\FAP\Problems\siemens4.ass");
     Console.WriteLine(" ... Done");
     FAPCostFunction costFunction = new FAPCostFunction(model);
     Console.Write("Calculating total amount of interference");
     double interference = costFunction.Evaluate(model.Cells);
     Console.WriteLine(" ... Done");
     Console.WriteLine("Total Interference: {0}", interference);
     Console.WriteLine("Projected Interference from assignment file: {0}", 2.200);
 }
Exemplo n.º 3
0
 public void RunTest(String problemPath, String assignmentPath)
 {
     FAPModelFactory factory = new FAPModelFactory();
     Console.Write("Creating model from problem file given at : {0}", problemPath);
     FAPModel model = factory.CreateModel(problemPath);
     Console.WriteLine(" ... Done");
     Console.Write("Loading assignment file given at: {0}", assignmentPath);
     model.LoadTestData(assignmentPath);
     Console.WriteLine(" ... Done");
     FAPCostFunction costFunction = new FAPCostFunction(model);
     Console.Write("Calculating total amount of interference");
     double interference = costFunction.Evaluate(model.Cells);
     Console.WriteLine(" ... Done");
     Console.WriteLine("Total Interference: {0}", interference);
 }