TCPSPSuite
visualizer.hpp
1 #ifndef VISUALIZER_H
2 #define VISUALIZER_H
3 
4 #include "instance/solution.hpp"
5 
6 #include <cairo.h>
7 
8 #define BASE_WIDTH 40
9 #define BASE_HEIGHT 40
10 
11 #define RES_UNIT_HEIGHT 40
12 #define TIME_UNIT_WIDTH 40
13 #define TICK_SIZE 20
14 
15 class Visualizer {
16 public:
17  Visualizer(const Solution &solution);
18  ~Visualizer();
19 
20  void write(std::string filename);
21 
22 private:
23  const Solution &solution;
24  const Instance &instance;
25 
26  cairo_surface_t *surface;
27  cairo_t *cr;
28 
29  std::map<unsigned int, std::map<unsigned int, double>> baselines;
30  std::vector<double> field_height;
31 
32  int latest_activity;
33 
34  double img_height;
35  double img_width;
36 
37  void compute_lengths();
38  void draw_field(unsigned int res_id);
39  std::map<unsigned int, double> arrange_heights(unsigned int res_id);
40 };
41 
42 #endif
Instance
a TCPSP instance
Definition: instance.hpp:24
Solution
a soultion for a TCPSP instance
Definition: solution.hpp:17