#include <client_manager.h>
Collaboration diagram for DALT_Server::ClientManager:
Public Methods | |
ClientManager (allocationMethod alloc_method=weighted_random) | |
~ClientManager () | |
int | addClient (Client *client) |
Client* | findClientForEntity (Entity &e) throw (runtime_error) |
Client* | findClientForEntity (Entity &e, set< Client *> &excluded) throw (runtime_error) |
void | setAllocationMethod (allocationMethod method) |
void | print () |
Public Attributes | |
map<string,int> | agent_cost |
vector<Client*> | clients |
Protected Methods | |
Client* | bestClient (Entity &e, vector< Client *> &to_search) |
Client* | findClientForEntity (Entity &e, vector< Client *> &to_search) throw (runtime_error) |
Protected Attributes | |
allocationMethod | alloc_method |
float | total_power |
Private Types | |
enum | allocationMethod { random, weighted_random, best_client } |
It allocates them in groups and tries to redistribute the workload to minimise the number of groups
|
possible client allocation methods.
|
|
constructor.
|
|
destructor - does nothing.
|
|
adds a client to the list of available clients.
|
|
finds the most suitable client for a given entity. This assumes that both the entity processing time is fairly constant and that the processing conditions on each client are similar. If this is not the case in the simulation then use one of the other (random) allocation methods provided, as they might yield better results
|
|
finds the most suitable client for an Entity.
|
|
finds the most suitable client for an Entity (searching through all available clients).
|
|
finds the most suitable client for an Entity.
|
|
prints on stdout the current client allocation.
|
|
sets the allocation method used by findClientForEntity.
|
|
the time taken by an agent on the reference machine for benchmarks; the agents are specified by their types. The time is obtained by averaging the times reported by clients for each type of agent. |
|
possible client allocation methods - see ClientManager::ClientManager for details.
|
|
list of all clients.
|
|
total processing power of all clients.
|