Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1072


Ignore:
Timestamp:
12/29/08 08:06:58 (16 years ago)
Author:
gkronber
Message:

minor fixes for debugging refactored CEDMA infrastructure ##419 (Refactor CEDMA plugins).

Location:
branches/CEDMA-Refactoring-Ticket419
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs

    r1060 r1072  
    6464               .GroupBy(t => (int)((Literal)t.Property).Value);
    6565            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              }
    6771            }
    6872          }
     
    8791    public Execution GetNextJob() {
    8892      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;
    9299    }
    93100
     
    113120      StandardGP sgp = new StandardGP();
    114121      sgp.SetSeedRandomly = true;
    115       sgp.MaxGenerations = 100;
    116       sgp.PopulationSize = 10000;
     122      sgp.MaxGenerations = 1;
     123      sgp.PopulationSize = 1000;
    117124      sgp.Elites = 1;
    118125      sgp.ProblemInjector = probInjector;
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Executer.cs

    r1060 r1072  
    6969            // get an execution from the dispatcher and execute in grid via job-manager
    7070            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            }
    7578          }
    7679          // wait until any job is finished
     
    9093          }
    9194          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);
    10096          }
    10197        }
     
    105101      }
    106102    }
     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    }
    107122  }
    108123}
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.sln

    r1050 r1072  
    515515    {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.Visualization Debug|x86.Build.0 = Debug|x86
    516516    {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
    517518    {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    518519    {545CE756-98D8-423B-AC2E-6E7D70926E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     
    736737    {23117533-8A91-474E-BBF6-C39485D0810A}.Visualization Debug|x86.ActiveCfg = Debug|x86
    737738    {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
    739741    {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    740742    {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     
    749751    {1F5FA590-1D2D-406C-BDBD-03BAECEA3C80}.Visualization Debug|x86.ActiveCfg = Debug|x86
    750752    {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
    752755    {1F1CF3ED-374C-4288-995B-93F6B872F571}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    753756    {1F1CF3ED-374C-4288-995B-93F6B872F571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     
    762765    {1F1CF3ED-374C-4288-995B-93F6B872F571}.Visualization Debug|x86.ActiveCfg = Debug|x86
    763766    {1F1CF3ED-374C-4288-995B-93F6B872F571}.Visualization Debug|x86.Build.0 = Debug|x86
    764     {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86
    765     {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|Any CPU.Build.0 = Debug|x86
     767    {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
    766769    {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    767770    {74223A32-C726-4978-BE78-37113A18373C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     
    776779    {74223A32-C726-4978-BE78-37113A18373C}.Visualization Debug|x86.ActiveCfg = Debug|x86
    777780    {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
    779783    {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    780784    {7C20D100-8BEB-433A-9499-F075E2CB9297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     
    789793    {7C20D100-8BEB-433A-9499-F075E2CB9297}.Visualization Debug|x86.ActiveCfg = Debug|x86
    790794    {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
    792797    {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    793798    {6084CFB5-733F-449D-9F92-2E40D13F0514}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     
    899904    {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Visualization Debug|x86.ActiveCfg = Debug|x86
    900905    {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
    902908    {A0821479-801F-43DF-B788-AE92FB410DA9}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    903909    {A0821479-801F-43DF-B788-AE92FB410DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Note: See TracChangeset for help on using the changeset viewer.