All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prediction_time_advance_table.h
Go to the documentation of this file.
1 #ifndef PREDICTION_TIME_ADVANCE_TABLE_H_INCLUDED_
2 #define PREDICTION_TIME_ADVANCE_TABLE_H_INCLUDED_
3 
4 #include<string>
5 
6 #include "time.h"
7 #include "segment_graph.h"
8 
9 namespace risc {
10 
11 namespace sg {
12 
14 
15 public:
16 
17  PredictionTimeAdvanceTable(risc::sg::SegmentGraph &sg, int prediction_steps);
18 
24  void print();
25 
30  void print(std::string filename);
31 
36  int index_to_segment_id(int index);
37 
42  int segment_id_to_index(int segment_id);
43 
47  std::vector<std::vector< risc::sg::Time> > table_;
48 
52  std::vector<int> index_to_segment_;
53 
58 
59 private:
60 
65  void compute_table();
66 
71  void analyze(VertexDescriptor start, int steps);
72 
77 };
78 
79 } // end of namespace sg
80 
81 } // end of namespace risc
82 
83 #endif /* PREDICTION_TIME_ADVANCE_TABLE_H_INCLUDED_ */
84 
85 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
This class represents a segment graph for a process.
Definition: segment_graph.h:79
PredictionTimeAdvanceTable(risc::sg::SegmentGraph &sg, int prediction_steps)
Definition: prediction_time_advance_table.cpp:6
boost::graph_traits< Graph >::vertex_descriptor VertexDescriptor
Definition: segment_graph.h:34
int segment_id_to_index(int segment_id)
translates a given segment id to the related index
Definition: prediction_time_advance_table.cpp:139
std::vector< int > index_to_segment_
A mapping from index to segment id.
Definition: prediction_time_advance_table.h:52
int index_to_segment_id(int index)
translates a given index to the related segment id
Definition: prediction_time_advance_table.cpp:134
Definition: prediction_time_advance_table.h:13
void print()
This function prints the prediction time advance table in the terminal.
Definition: prediction_time_advance_table.cpp:150
void compute_table()
This function computes the prediction time advance table.
Definition: prediction_time_advance_table.cpp:34
std::vector< std::vector< risc::sg::Time > > table_
The actual table.
Definition: prediction_time_advance_table.h:47
void analyze(VertexDescriptor start, int steps)
This function computes the prediction time advance table.
Definition: prediction_time_advance_table.cpp:45
SegmentGraph & sg_
Reference to the actual segment graph.
Definition: prediction_time_advance_table.h:76
int prediction_steps_
The max steps to be predicted.
Definition: prediction_time_advance_table.h:57