Ejemplo n.º 1
0
        Schedule doCrossover(Schedule mother, Schedule father)
        {
            COTypes  temp  = crossOver;
            Schedule child = null;

            switch (temp)
            {
            case COTypes.SinglePoint:
                child = SinglePointCO(mother, father);
                break;

            case COTypes.TwoPoint:
                child = TwoPointCO(mother, father);
                break;

            case COTypes.Uniform:
                child = UniformCO(mother, father);
                child.Repair();
                break;

            case COTypes.OrderedX:
                child = OrderedCO(mother, father);
                break;
            }
            return(child);
        }
 /// <summary>
 /// Adds new item to <see cref="COTypes"/> list.
 /// <param name="typeName">Type described by the newly added <see cref="TypeSpecification"/></param>
 /// <param name="assemblyName">Assembly containing the described type</param>
 /// </summary>
 public void AddClassificationObject(string typeName, string assemblyName)
 {
     if (COTypes == null)
     {
         COTypes = new List <TypeSpecification>();
     }
     COTypes.Add(TypeSpecification.CreateSpecification(typeName, assemblyName));
 }
        /// <summary>
        /// Adds new item to <see cref="COTypes"/> list. ClassificationObject types to be used by engine to talk to specific types of data sources.
        /// <param name="coTypeSpecification">New data source provider specification</param>
        /// </summary>
        public void AddClassificationObject(TypeSpecification coTypeSpecification)
        {
            if (COTypes == null)
            {
                COTypes = new List <TypeSpecification>();
            }

            COTypes.Add(coTypeSpecification);
        }
Ejemplo n.º 4
0
 public GeneticMachine(int jobs, int procs, int macs, int popsize)
 {
     this.NumberOfJobs      = jobs;
     this.NumberOfProcesses = procs;
     this.NumberOfMachines  = macs;
     NumberOfJobsXProcess   = jobs * procs;
     mutOdd        = 1;
     minTimeOdd    = 0;
     groupSize     = 5;
     population    = new Schedule[popsize];
     popSize       = popsize;
     crossOver     = COTypes.Uniform;
     mutationTypes = MutationTypes.ExchangeValues;
     selectionType = SelectionTypes.Tournament;
     best          = null;
     nothingFound  = 0;
 }
 public GeneticMachine(int jobs, int procs, int macs, int popsize)
 {
     this.jobnum   = jobs;
     this.procnum  = procs;
     this.macnum   = macs;
     krlength      = jobs * procs;
     mutOdd        = 1;
     minTimeOdd    = 0;
     groupSize     = 5;
     population    = new Schedule[popsize];
     popSize       = popsize;
     crossOver     = COTypes.Uniform;
     mutationTypes = MutationTypes.ExchangeValues;
     selectionType = SelectionTypes.Tournament;
     best          = null;
     nothingFound  = 0;
 }