Flowlessly  0.1
Minimum cost maximum cost solver
 All Classes Functions Pages
graph_generator.h
1 // The Flowlessly project
2 // Copyright (c) 2013-2016 Ionel Gog <ionel.gog@cl.cam.ac.uk>
3 
4 #ifndef FLOWLESSLY_GRAPH_GENERATOR_H
5 #define FLOWLESSLY_GRAPH_GENERATOR_H
6 
7 #include <glog/logging.h>
8 #include <vector>
9 
10 #include "graphs/adjacency_map_graph.h"
11 
12 namespace flowlessly {
13 
15  public:
17  explicit GraphGenerator(uint32_t seed);
18  uint32_t Generate(uint32_t num_tasks, uint32_t num_machines,
19  vector<uint32_t>* machine_node_ids,
20  Graph* graph, FILE* out_graph_file);
21 
22  void GenerateChanges(uint32_t cluster_agg_node_id, uint32_t* num_machines,
23  vector<uint32_t>* machine_node_ids, uint32_t* num_tasks,
24  Graph* graph, FILE* out_changes_file);
25  uint32_t GenerateMachine(uint32_t sink_node_id,
26  uint32_t cluster_agg_node_id,
27  bool first_scheduling_iteration,
28  Graph* graph,
29  uint32_t* cur_rank_node_id,
30  uint32_t* machines_per_current_rack,
31  FILE* out_changes_file);
32  void GenerateTask(uint32_t cluster_agg_node_id,
33  uint32_t num_machines,
34  const vector<uint32_t>& machine_node_ids,
35  bool first_scheduling_iteration,
36  Graph* graph,
37  FILE* out_changes_file);
38 
39  private:
40  void GenerateArcChanges(uint32_t num_arc_changes,
41  vector<uint32_t>* machine_node_ids,
42  Graph* graph,
43  FILE* out_changes_file);
44 
45  uint32_t seed_;
46 };
47 
48 } // namespace flowlessly
49 #endif // FLOWLESSLY_GRAPH_GENERATOR_H
Definition: graph.h:80
Definition: graph_generator.h:14