Skip to content

Commit

Permalink
Fix a bug in node activation temporal networks
Browse files Browse the repository at this point in the history
  • Loading branch information
arashbm committed Oct 20, 2024
1 parent c7ce866 commit 9967986
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/reticula/random_networks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace reticula {
distribution `res_dist`.
At each activation of a node, a random outgoing link from that node is
selected an an event is added for that link.
selected an event is added for that link.
Note that for undirected networks, the activation times of each link are
the result of indipendent activation of the nodes incident to the link. For
Expand Down
8 changes: 2 additions & 6 deletions src/random_networks/activation_temporal.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace reticula {
edges.reserve(size_hint);

for (const auto& v: base_net.vertices()) {
auto links = base_net.out_edges();
auto links = base_net.out_edges(v);
if (links.empty()) continue;

std::uniform_int_distribution<std::size_t> idx(0, links.size() - 1);
Expand Down Expand Up @@ -141,12 +141,8 @@ namespace reticula {
if (size_hint > 0)
edges.reserve(size_hint);

for (const auto& e: base_net.edges())
for (typename EdgeT::TimeType t{}; t < max_t*2; t += iet_dist(generator))
if (t >= max_t) edges.emplace_back(e, t - max_t);

for (const auto& v: base_net.vertices()) {
auto links = base_net.out_edges();
auto links = base_net.out_edges(v);
if (links.empty()) continue;

std::uniform_int_distribution<std::size_t> idx(0, links.size() - 1);
Expand Down

0 comments on commit 9967986

Please sign in to comment.