//////////////////////////////////////////////////////////////////////
int main(int argc, char **argv) {
- int nb_locations = 4;
- int nb_time_steps = 3;
+ int nb_locations = 6;
+ int nb_time_steps = 5;
{
Tracker tracker(nb_time_steps, nb_locations);
for(int t = 0; t < nb_time_steps; t++) {
for(int l = 0; l < nb_locations; l++) {
tracker.set_detection_score(t, l,
- (drand48() < 0.95 ? -1.0 : 1.0) + drand48() * 0.1 - 0.05);
+ (drand48() < 0.9 ? -1.0 : 1.0) + drand48() * 0.1 - 0.05);
}
tracker.set_detection_score(t, 0,
- (drand48() < 0.95 ? 1.0 : -1.0) + drand48() * 0.1 - 0.05);
+ (drand48() < 0.9 ? 1.0 : -1.0) + drand48() * 0.1 - 0.05);
}
tracker.build_graph();
cout << "}" << endl;
}
-
-void dot_print(int nb_vertices,
- int nb_edges, int *ea, int *eb, scalar_t *el,
- int _source, int _sink,
- int *edge_occupation) {
- for(int e = 0; e < nb_edges; e++) {
- }
- cout << "}" << endl;
-}
MTPGraph::MTPGraph(int nb_vertices, int nb_edges,
int *from, int *to,
int src, int snk) {
edges = new Edge[_nb_edges];
vertices = new Vertex[_nb_vertices];
+ _front = new Vertex *[_nb_vertices];
+ _new_front = new Vertex *[_nb_vertices];
_source = &vertices[src];
_sink = &vertices[snk];
edges[e].terminal_vertex = &vertices[to[e]];
}
- _front = new Vertex *[_nb_vertices];
- _new_front = new Vertex *[_nb_vertices];
}
MTPGraph::~MTPGraph() {
}
}
-void MTPGraph::update_work_length() {
+void MTPGraph::update_work_lengths() {
for(int n = 0; n < _nb_vertices; n++) {
scalar_t d = vertices[n].distance_from_source;
for(Edge *e = vertices[n].root_edge; e; e = e->next) {
do {
total_length = 0.0;
find_shortest_path(_front, _new_front);
- update_work_length();
+ update_work_lengths();
// Do we reach the _sink?
if(_sink->pred_edge) {
class MTPGraph {
void initialize_work_lengths();
- void update_work_length();
+ void update_work_lengths();
void find_shortest_path(Vertex **front, Vertex **new_front);
int _nb_vertices, _nb_edges;