Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/08 17:59:19 (16 years ago)
Author:
gkronber
Message:

worked on #211 need to patch the operator-graph of an agent before execution (replacing the OperatorLinks with their targets).

work in progress...

Location:
trunk/sources/HeuristicLab.CEDMA.Server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj

    r403 r419  
    7171  </ItemGroup>
    7272  <ItemGroup>
     73    <ProjectReference Include="..\HeuristicLab.CEDMA.Core\HeuristicLab.CEDMA.Core.csproj">
     74      <Project>{C27DDF6C-84DF-45EF-B82F-57A28DD51166}</Project>
     75      <Name>HeuristicLab.CEDMA.Core</Name>
     76    </ProjectReference>
    7377    <ProjectReference Include="..\HeuristicLab.CEDMA.DB.Interfaces\HeuristicLab.CEDMA.DB.Interfaces.csproj">
    7478      <Project>{4F9BB789-D561-436B-B226-2BF44B7D0804}</Project>
     
    9094      <Project>{545CE756-98D8-423B-AC2E-6E7D70926E5C}</Project>
    9195      <Name>HeuristicLab.Grid</Name>
     96    </ProjectReference>
     97    <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
     98      <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project>
     99      <Name>HeuristicLab.Operators</Name>
    92100    </ProjectReference>
    93101    <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
  • trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs

    r403 r419  
    3131using System.Diagnostics;
    3232using HeuristicLab.Data;
     33using HeuristicLab.CEDMA.Core;
     34using HeuristicLab.Operators;
    3335
    3436namespace HeuristicLab.CEDMA.Server {
     
    7375        scope.AddVariable(new Variable("CedmaServerUri", new StringData(serverUri)));
    7476        IOperatorGraph opGraph = (IOperatorGraph)PersistenceManager.RestoreFromGZip(entry.RawData);
    75         AtomicOperation op = new AtomicOperation(opGraph.InitialOperator, scope);
     77
     78        foreach(IOperator op in opGraph.Operators) {
     79          PatchLinks(op);
     80        }
     81
     82        AtomicOperation operation = new AtomicOperation(opGraph.InitialOperator, scope);
    7683        WaitHandle wHandle;
    7784        lock(remoteCommLock) {
    78           wHandle = jobManager.BeginExecuteOperation(op.Scope, op);
     85          wHandle = jobManager.BeginExecuteOperation(operation.Scope, operation);
    7986          database.UpdateAgent(entry.Id, ProcessStatus.Active);
    8087        }
     
    8289        Job job = new Job();
    8390        job.AgentId = entry.Id;
    84         job.Operation = op;
     91        job.Operation = operation;
    8592        job.WaitHandle = wHandle;
    8693
     
    9097        }
    9198      }
     99    }
     100
     101    private void PatchLinks(IOperator op) {
     102      if(op is OperatorLink) {
     103        OperatorLink link = op as OperatorLink;
     104        OperatorEntry targetEntry = database.GetOperator(link.Id);
     105        IOperator target = (IOperator)PersistenceManager.RestoreFromGZip(targetEntry.RawData);
     106        ReplaceOperatorInGraph(link, target);
     107      } else if(op is CombinedOperator) {
     108        CombinedOperator combinedOp = op as CombinedOperator;
     109        foreach(IOperator internalOp in combinedOp.OperatorGraph.Operators) {
     110          PatchLinks(internalOp);
     111        }
     112      }
     113    }
     114
     115    private void ReplaceOperatorInGraph(OperatorLink link, IOperator target) {
     116      throw new NotImplementedException();
    92117    }
    93118
Note: See TracChangeset for help on using the changeset viewer.