コード例 #1
0
 public SchedulingGenomePopulation(
     int size, GAScheduler scheduler, SchedulingGenome initGenome,
     int nInit)
     : base(size)
 {
     this.scheduler = scheduler;
     this.initGenome = initGenome;
     this.nInit = nInit;
 }
コード例 #2
0
ファイル: GACodeGenerator.cs プロジェクト: harnold/cobe
        public GACodeGenerator(
            GAInstructionSelectorConfiguration selectorConfiguration,
            GASchedulerConfiguration schedulerConfiguration)
        {
            this.selectorConfiguration = selectorConfiguration;
            this.schedulerConfiguration = schedulerConfiguration;

            selector = new GAInstructionSelector(this);
            scheduler = selector.Scheduler;
        }
コード例 #3
0
ファイル: SchedulingGenome.cs プロジェクト: harnold/cobe
        public SchedulingGenome(SchedulingGenomePopulation population)
        {
            this.population = population;
            this.scheduler = population.Scheduler;

            int maxSchedulingSteps = InstructionNodes.Count;

            schedule = new InstructionNode[
                maxSchedulingSteps, MachineDescription.ExecutionUnits];

            instructionInfos = new Hashtable(InstructionNodes.Count);

            foreach (InstructionNode iNode in InstructionNodes)
                instructionInfos[iNode] = new InstructionInfo();

            valueInfos = new Hashtable(RegisterValues.Count);

            foreach (ValueNode vNode in RegisterValues)
                valueInfos[vNode] = new ValueInfo();

            isValid = false;

            generationOfBirth = population.GA.Generation;
        }
コード例 #4
0
ファイル: GAInstructionSelector.cs プロジェクト: harnold/cobe
 public GAInstructionSelector(GACodeGenerator codeGenerator)
 {
     this.codeGenerator = codeGenerator;
     configuration = codeGenerator.SelectorConfiguration;
     scheduler = new GAScheduler(codeGenerator);
 }
コード例 #5
0
 public SelectionGenomeEvaluator(GAScheduler scheduler)
 {
     this.scheduler = scheduler;
 }
コード例 #6
0
 public SchedulingGenomePopulation(int size, GAScheduler scheduler)
     : base(size)
 {
     this.scheduler = scheduler;
 }
コード例 #7
0
ファイル: SchedulingGenome.cs プロジェクト: harnold/cobe
        public virtual void Copy(
            SchedulingGenome other,
            IDictionary instructionMap,
            IDictionary valueMap)
        {
            population = other.population;
            scheduler = other.scheduler;

            schedule = new InstructionNode[
                other.schedule.GetLength(0),
                other.schedule.GetLength(1)];

            for (int i = 0; i < schedule.GetLength(0); i++) {
                for (int j = 0; j < schedule.GetLength(1); j++) {

                    InstructionNode iNode = other.schedule[i, j];

                    if (iNode != null) {
                        schedule[i, j] =
                            (InstructionNode) instructionMap[other.schedule[i, j]];
                    } else {
                        schedule[i, j] = null;
                    }
                }
            }

            valueInfos = new Hashtable();

            foreach (ValueNode vNode in other.ValueInfos.Keys) {

                ValueInfo info = new ValueInfo();
                ValueInfo otherInfo = other.GetValueInfo(vNode);

                info.Register = otherInfo.Register;
                info.Production = otherInfo.Production;
                info.LastUsage = otherInfo.LastUsage;
                valueInfos[valueMap[vNode]] = info;
            }

            instructionInfos = new Hashtable();

            foreach (InstructionNode iNode in other.InstructionInfos.Keys) {

                InstructionInfo info = new InstructionInfo();
                InstructionInfo otherInfo = other.GetInstructionInfo(iNode);

                info.SchedulingStep = otherInfo.SchedulingStep;
                instructionInfos[instructionMap[iNode]] = info;
            }

            isValid = other.isValid;
            scheduleLength = other.scheduleLength;
            violatedSchedulingConstraints = other.violatedSchedulingConstraints;
            violatedRegisterConstraints = other.violatedRegisterConstraints;
            generationOfBirth = other.generationOfBirth;
        }
コード例 #8
0
ファイル: SchedulingGenome.cs プロジェクト: harnold/cobe
        public virtual void Copy(IGenome otherGenome)
        {
            SchedulingGenome other = (SchedulingGenome) otherGenome;

            population = other.population;
            scheduler = other.scheduler;

            schedule = new InstructionNode[
                other.schedule.GetLength(0),
                other.schedule.GetLength(1)];

            for (int i = 0; i < schedule.GetLength(0); i++)
                for (int j = 0; j < schedule.GetLength(1); j++)
                    schedule[i, j] = other.schedule[i, j];

            valueInfos = new Hashtable();

            foreach (ValueNode vNode in other.ValueInfos.Keys) {

                ValueInfo info = new ValueInfo();
                ValueInfo otherInfo = other.GetValueInfo(vNode);

                info.Register = otherInfo.Register;
                info.Production = otherInfo.Production;
                info.LastUsage = otherInfo.LastUsage;
                valueInfos[vNode] = info;
            }

            instructionInfos = new Hashtable();

            foreach (InstructionNode iNode in other.InstructionInfos.Keys) {

                InstructionInfo info = new InstructionInfo();
                InstructionInfo otherInfo = other.GetInstructionInfo(iNode);

                info.SchedulingStep = otherInfo.SchedulingStep;
                instructionInfos[iNode] = info;
            }

            isValid = other.isValid;
            scheduleLength = other.scheduleLength;
            violatedSchedulingConstraints = other.violatedSchedulingConstraints;
            violatedRegisterConstraints = other.violatedRegisterConstraints;
            generationOfBirth = other.generationOfBirth;
        }