コード例 #1
0
        public LinearAssignmentProblem()
            : base(new LAPEvaluator(), new RandomPermutationCreator())
        {
            Parameters.Add(new ValueParameter <DoubleMatrix>("Costs", CostsDescription, new DoubleMatrix(3, 3)));
            Parameters.Add(new OptionalValueParameter <ItemSet <Permutation> >("BestKnownSolutions", "The list of best known solutions which is updated whenever a new better solution is found or may be the optimal solution if it is known beforehand.", null));
            Parameters.Add(new OptionalValueParameter <Permutation>("BestKnownSolution", "The best known solution which is updated whenever a new better solution is found or may be the optimal solution if it is known beforehand.", null));
            Parameters.Add(new OptionalValueParameter <StringArray>("RowNames", RowNamesDescription));
            Parameters.Add(new OptionalValueParameter <StringArray>("ColumnNames", ColumnNamesDescription));

            ((ValueParameter <DoubleMatrix>)CostsParameter).ReactOnValueToStringChangedAndValueItemImageChanged              = false;
            ((OptionalValueParameter <StringArray>)RowNamesParameter).ReactOnValueToStringChangedAndValueItemImageChanged    = false;
            ((OptionalValueParameter <StringArray>)ColumnNamesParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;

            RowNames    = new StringArray(new string[] { "Eric", "Robert", "Allison" });
            ColumnNames = new StringArray(new string[] { "MRI", "Blood test", "Angiogram" });
            Costs[0, 0] = 4; Costs[0, 1] = 5; Costs[0, 2] = 3;
            Costs[1, 0] = 6; Costs[1, 1] = 6; Costs[1, 2] = 4;
            Costs[2, 0] = 5; Costs[2, 1] = 5; Costs[2, 2] = 1;

            bestLAPSolutionAnalyzer = new BestLAPSolutionAnalyzer();
            SolutionCreator.PermutationParameter.ActualName = "Assignment";
            InitializeOperators();
            Parameterize();
            AttachEventHandlers();
        }
コード例 #2
0
 protected BestLAPSolutionAnalyzer(BestLAPSolutionAnalyzer original, Cloner cloner) : base(original, cloner)
 {
 }
コード例 #3
0
 private LinearAssignmentProblem(LinearAssignmentProblem original, Cloner cloner)
     : base(original, cloner)
 {
     this.bestLAPSolutionAnalyzer = cloner.Clone(original.bestLAPSolutionAnalyzer);
     AttachEventHandlers();
 }
コード例 #4
0
 protected BestLAPSolutionAnalyzer(BestLAPSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }