Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/13/08 13:36:57 (16 years ago)
Author:
gkronber
Message:
  • asynchronous downloading of agents and results from the CEDMA server
  • created a chart that displays points as bubbles (scatter-plot + optional third dimension for the size of the bubble, larger bubbles are more transparent than smaller bubbles)

ticket #268 (Possibility to open the function-tree of any model (represented as point in the scatter-plot))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentList.cs

    r510 r561  
    4040      set {
    4141        database = value;
    42         ReloadList();
    43         FireChanged();
     42        Action reload = ReloadList;
     43        lock(agentList) {
     44          agentList.Clear();
     45        }
     46        reload.BeginInvoke(null, null);
    4447      }
    4548    }
    4649
    4750    private void ReloadList() {
    48       agentList.Clear();
    4951      foreach(AgentEntry a in database.GetAgents()) {
    5052        Agent newAgent = new Agent(Database, a.Id);
    5153        newAgent.Name = a.Name;
    5254        newAgent.Status = a.Status;
    53         agentList.Add(newAgent);
     55        lock(agentList) {
     56          agentList.Add(newAgent);
     57        }
     58        FireChanged();
    5459      }
    5560    }
     
    6772      long id = database.InsertAgent(null, agent.Name, PersistenceManager.SaveToGZip(agent.OperatorGraph));
    6873      agent.Id = id;
    69       agentList.Add(agent);
     74      lock(agentList) {
     75        agentList.Add(agent);
     76      }
    7077      FireChanged();
    7178    }
    7279
    7380    public IEnumerator<IAgent> GetEnumerator() {
    74       ReloadList();
    75       return agentList.GetEnumerator();
     81      List<IAgent> agents = new List<IAgent>();
     82      lock(agentList) {
     83        agents.AddRange(agentList);
     84      }
     85      return agents.GetEnumerator();
    7686    }
    7787
Note: See TracChangeset for help on using the changeset viewer.