Skip to content

Commit

Permalink
bugs again
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetris3 committed May 16, 2024
1 parent 02d4bcb commit 6351577
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions instance_generator/InstanceGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ void InstanceGenerator::generate_shipments(
destination_hub_id = st_network.get_vertices().at(arc.get_arrival_id()).get_id_in_graph();
arrival_time = st_network.get_vertices().at(arc.get_arrival_id()).get_time();
int last_vertex = arc.get_arrival_id();
assert(source_hub_id!=destination_hub_id);

// Sample a path in the st_network starting at the (source hub,
// departure_time)
Expand Down Expand Up @@ -447,18 +448,21 @@ void InstanceGenerator::generate_shipments(
if (next_vertex.get_id_in_graph() != source_hub_id) {
destination_hub_id = next_vertex.get_id_in_graph();
arrival_time = next_vertex.get_time();
assert(source_hub_id!=destination_hub_id);
}
if (ElRandom::Bernoulli(prob_stop)) {
break;
}
}
number++;
assert(source_hub_id!=destination_hub_id);
string destination_name = st_network.get_underlying_graph()
.get_vertex(destination_hub_id)
.get_name();
string source_name = st_network.get_underlying_graph()
.get_vertex(source_hub_id)
.get_name();
assert(destination_name!=source_name);
add_shipment(instance, number, source_name, destination_name,
departure_time, arrival_time, shipment_weights.at(k));

Expand Down

0 comments on commit 6351577

Please sign in to comment.