Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/10/08 17:33:27 (15 years ago)
Author:
gkronber
Message:

worked on #419 (Refactor CEDMA plugins)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSet.cs

    r928 r957  
    3030
    3131namespace HeuristicLab.CEDMA.Core {
    32   public class Agent : IAgent {
    33     public IDatabase Database { get; set; }
     32  public class DataSet {
     33    public IStore Store { get; set; }
    3434    public long Id { get; set; }
    3535    public string Name { get; set; }
    36     public ProcessStatus Status { get; set; }
    37     public bool Terminated { get; set; }
    38     private OperatorGraph operatorGraph;
     36    private Problem problem;
    3937
    40     public IOperatorGraph OperatorGraph {
    41       get { return operatorGraph; }
     38    public Problem Problem {
     39      get { return problem; }
    4240    }
    4341
    44     public Agent()
     42    public DataSet()
    4543      : base() {
    46       operatorGraph = new OperatorGraph();
     44      problem = new Problem();
    4745    }
    4846
    49     public Agent(IDatabase database, long id)
     47    public DataSet(IStore store, long id)
    5048      : this() {
    51       Database = database;
     49      Store = store;
    5250      Id = id;
    5351    }
    5452
    5553    public void Save() {
    56       Database.UpdateAgent(Id, Name);
    57       Database.UpdateAgent(Id, Status);
    58       Database.UpdateAgent(Id, PersistenceManager.SaveToGZip(OperatorGraph));
     54      throw new NotImplementedException();
    5955    }
    6056
    61     public void Start() {
    62       Status = ProcessStatus.Waiting;
    63       Save();
     57    public void Activate() {
     58      throw new NotImplementedException();
    6459    }
    6560
    66     public ICollection<IAgent> SubAgents {
    67       get {
    68         List<IAgent> agents = new List<IAgent>();
    69         foreach(AgentEntry entry in Database.GetSubAgents(Id)) {
    70           Agent newAgent = new Agent(Database, entry.Id);
    71           newAgent.Name = entry.Name;
    72           newAgent.Status = entry.Status;
    73           agents.Add(newAgent);
    74         }
    75         return agents;
    76       }
    77     }
    78 
    79     public ICollection<IResult> Results {
    80       get {
    81         List<IResult> results = new List<IResult>();
    82         foreach(ResultEntry entry in Database.GetResults(Id)) {
    83           Result result = new Result(Database, entry.Id);
    84           result.Summary = entry.Summary;
    85           result.Description = entry.Description;
    86           results.Add(result);
    87         }
    88         return results;
    89       }
     61    private void UpdateDataSet(long Id, byte[] p) {
     62      throw new NotImplementedException();
    9063    }
    9164
    9265    public IView CreateView() {
    93       if(OperatorGraph.Operators.Count == 0) {
    94         byte[] rawData = Database.GetAgentRawData(Id);
    95         IOperatorGraph opGraph = (IOperatorGraph)PersistenceManager.RestoreFromGZip(rawData);
    96         foreach(IOperator op in opGraph.Operators) OperatorGraph.AddOperator(op);
    97         OperatorGraph.InitialOperator = opGraph.InitialOperator;
    98         OperatorLinkPatcher.LinkDatabase(OperatorGraph, Database);
    99       }
    100       return new AgentView(this);
     66      return new DataSetView(this);
    10167    }
    10268  }
Note: See TracChangeset for help on using the changeset viewer.