Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/08 23:29:18 (16 years ago)
Author:
gkronber
Message:

worked on very basic control to view the tree of agents/runs (ticket #188)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Operators/OnGridProcessor.cs

    r390 r393  
    4040      AddVariableInfo(new VariableInfo("AgentId", "Id of the agent that the run should be associated to.", typeof(IntData), VariableKind.In));
    4141      AddVariableInfo(new VariableInfo("OperatorGraph", "The operator graph that should be executed on the grid", typeof(IOperatorGraph), VariableKind.In));
    42       AddVariableInfo(new VariableInfo("ServerUrl", "Url of the CEDMA server", typeof(StringData), VariableKind.In));
     42      AddVariableInfo(new VariableInfo("CedmaServerUri", "Uri of the CEDMA server", typeof(StringData), VariableKind.In));
    4343    }
    4444
     
    4646     
    4747      IOperatorGraph operatorGraph = scope.GetVariableValue<IOperatorGraph>("OperatorGraph", false);
    48       string serverUrl = scope.GetVariableValue<StringData>("ServerUrl", true).Data;
     48      string serverUrl = scope.GetVariableValue<StringData>("CedmaServerUri", true).Data;
    4949      long agentId = scope.GetVariableValue<IntData>("AgentId", true).Data;
     50
     51      Agent agent = new Agent();
     52      foreach(IOperator op in operatorGraph.Operators) {
     53        agent.OperatorGraph.AddOperator(op);
     54      }
     55      agent.OperatorGraph.InitialOperator = operatorGraph.InitialOperator;
    5056
    5157      NetTcpBinding binding = new NetTcpBinding();
     
    5662      using(ChannelFactory<IDatabase> factory = new ChannelFactory<IDatabase>(binding)) {
    5763        IDatabase database = factory.CreateChannel(new EndpointAddress(serverUrl));
    58         long id = database.InsertAgent(agentId, null, false, DbPersistenceManager.Save(operatorGraph));
     64        long id = database.InsertAgent(agentId, null, false, DbPersistenceManager.Save(agent));
    5965        database.UpdateAgent(id, ProcessStatus.Waiting);
    6066      }
Note: See TracChangeset for help on using the changeset viewer.