Changeset 1072
- Timestamp:
- 12/29/08 08:06:58 (16 years ago)
- Location:
- branches/CEDMA-Refactoring-Ticket419
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs
r1060 r1072 64 64 .GroupBy(t => (int)((Literal)t.Property).Value); 65 65 foreach (var targetVariable in targetVariableStatements) { 66 numberOfModelsOfTargetVariableOfDataSet[datasetStatement.Subject].Add(targetVariable.Key, targetVariable.Count()); 66 if (numberOfModelsOfTargetVariableOfDataSet[datasetStatement.Subject].ContainsKey(targetVariable.Key)) { 67 numberOfModelsOfTargetVariableOfDataSet[datasetStatement.Subject][targetVariable.Key] = targetVariable.Count(); 68 } else { 69 numberOfModelsOfTargetVariableOfDataSet[datasetStatement.Subject].Add(targetVariable.Key, targetVariable.Count()); 70 } 67 71 } 68 72 } … … 87 91 public Execution GetNextJob() { 88 92 if (dispatchQueue.Count == 0) FillDispatchQueue(); 89 Execution next = dispatchQueue[0]; 90 dispatchQueue.RemoveAt(0); 91 return next; 93 if (dispatchQueue.Count > 0) { 94 Execution next = dispatchQueue[0]; 95 dispatchQueue.RemoveAt(0); 96 return next; 97 } else 98 return null; 92 99 } 93 100 … … 113 120 StandardGP sgp = new StandardGP(); 114 121 sgp.SetSeedRandomly = true; 115 sgp.MaxGenerations = 1 00;116 sgp.PopulationSize = 1000 0;122 sgp.MaxGenerations = 1; 123 sgp.PopulationSize = 1000; 117 124 sgp.Elites = 1; 118 125 sgp.ProblemInjector = probInjector; -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Executer.cs
r1060 r1072 69 69 // get an execution from the dispatcher and execute in grid via job-manager 70 70 Execution execution = dispatcher.GetNextJob(); 71 AtomicOperation op = new AtomicOperation(execution.Engine.OperatorGraph.InitialOperator, execution.Engine.GlobalScope); 72 WaitHandle opWh = jobManager.BeginExecuteOperation(execution.Engine.GlobalScope, op); 73 wh.Add(opWh); 74 activeOperations.Add(opWh, op); 71 if (execution != null) { 72 AtomicOperation op = new AtomicOperation(execution.Engine.OperatorGraph.InitialOperator, execution.Engine.GlobalScope); 73 WaitHandle opWh = jobManager.BeginExecuteOperation(execution.Engine.GlobalScope, op); 74 wh.Add(opWh); 75 activeOperations.Add(opWh, op); 76 activeExecutions.Add(opWh, execution); 77 } 75 78 } 76 79 // wait until any job is finished … … 90 93 } 91 94 if (finishedEngine != null) { 92 Entity modelEntity = new Entity(Ontology.CedmaNameSpace+Guid.NewGuid()); 93 store.Add(new Statement(modelEntity, Ontology.PredicateInstanceOf, Ontology.TypeGeneticProgrammingFunctionTree)); 94 Entity targetVariableAttr = new Entity(Ontology.CedmaNameSpace+Guid.NewGuid()); 95 store.Add(new Statement(modelEntity, Ontology.PredicateModelAttribute, targetVariableAttr)); 96 store.Add(new Statement(targetVariableAttr, Ontology.PredicateModelAttributeName, new Literal("TargetVariable"))); 97 store.Add(new Statement(targetVariableAttr, Ontology.PredicateModelAttributeValue, new Literal(finishedExecution.TargetVariable))); 98 store.Add(new Statement(targetVariableAttr, Ontology.PredicateModelAttributeType, Ontology.TypeCategoricalAttribute)); 99 store.Add(new Statement(finishedExecution.DataSetEntity, Ontology.PredicateHasModel, modelEntity)); 95 StoreResults(finishedExecution, finishedEngine); 100 96 } 101 97 } … … 105 101 } 106 102 } 103 104 private void StoreResults(Execution finishedExecution, ProcessingEngine finishedEngine) { 105 Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid()); 106 store.Add(new Statement(modelEntity, Ontology.PredicateInstanceOf, Ontology.TypeGeneticProgrammingFunctionTree)); 107 store.Add(new Statement(finishedExecution.DataSetEntity, Ontology.PredicateHasModel, modelEntity)); 108 Entity targetVariableAttr = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid()); 109 store.Add(new Statement(modelEntity, Ontology.PredicateModelAttribute, targetVariableAttr)); 110 store.Add(new Statement(targetVariableAttr, Ontology.PredicateModelAttributeName, new Literal("TargetVariable"))); 111 store.Add(new Statement(targetVariableAttr, Ontology.PredicateModelAttributeValue, new Literal(finishedExecution.TargetVariable))); 112 store.Add(new Statement(targetVariableAttr, Ontology.PredicateModelAttributeType, Ontology.TypeCategoricalAttribute)); 113 114 Scope bestModelScope = finishedEngine.GlobalScope.GetVariableValue<Scope>("BestValidationSolution", false); 115 double validationMape = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data; 116 Entity validationMapeAttr = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid()); 117 store.Add(new Statement(modelEntity, Ontology.PredicateModelAttribute, validationMapeAttr)); 118 store.Add(new Statement(validationMapeAttr, Ontology.PredicateModelAttributeName, new Literal("ValidationMeanAbsolutePercentageError"))); 119 store.Add(new Statement(validationMapeAttr, Ontology.PredicateModelAttributeValue, new Literal(validationMape))); 120 store.Add(new Statement(validationMapeAttr, Ontology.PredicateModelAttributeType, Ontology.TypeOrdinalAttribute)); 121 } 107 122 } 108 123 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.sln
r1050 r1072 515 515 {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.Visualization Debug|x86.Build.0 = Debug|x86 516 516 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 517 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|Any CPU.Build.0 = Debug|x86 517 518 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|x86.ActiveCfg = Debug|x86 518 519 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU … … 736 737 {23117533-8A91-474E-BBF6-C39485D0810A}.Visualization Debug|x86.ActiveCfg = Debug|x86 737 738 {23117533-8A91-474E-BBF6-C39485D0810A}.Visualization Debug|x86.Build.0 = Debug|x86 738 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 739 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.CEDMA Debug|Any CPU.ActiveCfg = Release|x86 740 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.CEDMA Debug|Any CPU.Build.0 = Release|x86 739 741 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.CEDMA Debug|x86.ActiveCfg = Debug|x86 740 742 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU … … 749 751 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.Visualization Debug|x86.ActiveCfg = Debug|x86 750 752 {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.Visualization Debug|x86.Build.0 = Debug|x86 751 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 753 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|Any CPU.ActiveCfg = Release|x86 754 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|Any CPU.Build.0 = Release|x86 752 755 {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|x86.ActiveCfg = Debug|x86 753 756 {1F1CF3ED-374C-4288-995B-93F6B872F571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU … … 762 765 {1F1CF3ED-374C-4288-995B-93F6B872F571}.Visualization Debug|x86.ActiveCfg = Debug|x86 763 766 {1F1CF3ED-374C-4288-995B-93F6B872F571}.Visualization Debug|x86.Build.0 = Debug|x86 764 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86765 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|Any CPU.Build.0 = Debug|x86767 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|Any CPU.ActiveCfg = Release|x86 768 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|Any CPU.Build.0 = Release|x86 766 769 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|x86.ActiveCfg = Debug|x86 767 770 {74223A32-C726-4978-BE78-37113A18373C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU … … 776 779 {74223A32-C726-4978-BE78-37113A18373C}.Visualization Debug|x86.ActiveCfg = Debug|x86 777 780 {74223A32-C726-4978-BE78-37113A18373C}.Visualization Debug|x86.Build.0 = Debug|x86 778 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 781 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|Any CPU.ActiveCfg = Release|x86 782 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|Any CPU.Build.0 = Release|x86 779 783 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|x86.ActiveCfg = Debug|x86 780 784 {7C20D100-8BEB-433A-9499-F075E2CB9297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU … … 789 793 {7C20D100-8BEB-433A-9499-F075E2CB9297}.Visualization Debug|x86.ActiveCfg = Debug|x86 790 794 {7C20D100-8BEB-433A-9499-F075E2CB9297}.Visualization Debug|x86.Build.0 = Debug|x86 791 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 795 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|Any CPU.ActiveCfg = Release|x86 796 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|Any CPU.Build.0 = Release|x86 792 797 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|x86.ActiveCfg = Debug|x86 793 798 {6084CFB5-733F-449D-9F92-2E40D13F0514}.Debug|Any CPU.ActiveCfg = Debug|Any CPU … … 899 904 {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Visualization Debug|x86.ActiveCfg = Debug|x86 900 905 {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Visualization Debug|x86.Build.0 = Debug|x86 901 {A0821479-801F-43DF-B788-AE92FB410DA9}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 906 {A0821479-801F-43DF-B788-AE92FB410DA9}.CEDMA Debug|Any CPU.ActiveCfg = Release|x86 907 {A0821479-801F-43DF-B788-AE92FB410DA9}.CEDMA Debug|Any CPU.Build.0 = Release|x86 902 908 {A0821479-801F-43DF-B788-AE92FB410DA9}.CEDMA Debug|x86.ActiveCfg = Debug|x86 903 909 {A0821479-801F-43DF-B788-AE92FB410DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Note: See TracChangeset
for help on using the changeset viewer.