@@ -157,16 +157,16 @@ class EdgeGeometryView : public ContainerView<EdgeGeomertyType>
157157 * The network consists of nodes connected by edges. Edges are spatially represented
158158 * as segments. Edges themselves don't carry cost and have meaning only as indicators of
159159 * existence of a connection between nodes. Cost for each edge is a travel distance
160- * determined by advancing through cells in a segment.
160+ * (cost) determined by advancing through all cells in a segment.
161161 *
162162 * Nodes are the hop-on locations for dispersers. The dispersers can hop-off anywhere.
163163 *
164164 * The general workflow is contructing the object (with the constructor) and loading the
165165 * data (with the load() function). Then the network is ready to be used for simulating
166- * trips over the network (with the travel () function ).
166+ * trips over the network (with the walk () or teleport() functions ).
167167 *
168- * When the travel () function is used from a kernel, user of the network directly calls
169- * only the setup functions.
168+ * When the walk () or teleport() functions are used from a kernel, user of the network
169+ * directly calls only the setup functions.
170170 *
171171 * The class exposes number of functions as public which are meant for testing or other
172172 * special workflows.
@@ -449,7 +449,7 @@ class Network
449449 }
450450
451451 /* *
452- * Travel given distance in the network from given row and column.
452+ * Walk a given distance (cost) in the network from given row and column.
453453 *
454454 * All previously visited nodes are tracked and, if possible, excluded
455455 * from further traveling.
@@ -458,20 +458,20 @@ class Network
458458 * the decision to call this function was based on the caller knowing there is a
459459 * node. If there is no node, an std::invalid_argument exception is thrown.
460460 * If there is more than one node at the given *row* and *column*, a random node is
461- * picked and used for traveling .
461+ * picked and used as a next walking destination .
462462 *
463- * If *snap * is true, then results are snapped to the closest node, otherwise
463+ * If *jump * is true, then results are snapped to the closest node, otherwise
464464 * result can be anywhere in between the nodes based on the edge geomerty (segment).
465465 *
466466 * @returns Final row and column pair
467467 */
468468 template <typename Generator>
469- std::tuple<int , int > travel (
469+ std::tuple<int , int > walk (
470470 RasterIndex row,
471471 RasterIndex col,
472472 double distance,
473473 Generator& generator,
474- bool snap = false ) const
474+ bool jump = false ) const
475475 {
476476 auto node_id = get_random_node_at (row, col, generator);
477477 std::set<NodeId> visited_nodes;
@@ -494,26 +494,27 @@ class Network
494494 distance -= segment.cost ();
495495 continue ;
496496 }
497- if (snap ) {
497+ if (jump ) {
498498 if (distance < segment.cost () / 2 ) {
499499 // Less than half snaps to the start node.
500500 return segment.front ();
501501 }
502502 // Half or more snaps to the end node.
503503 return segment.back ();
504504 }
505- // No snapping, advance in a segment.
505+ // No jumping ( snapping) , advance in a segment.
506506 // This includes the special cases when distance is 0 or total segment cost.
507507 return segment.cell_by_cost (distance);
508508 }
509509 throw std::invalid_argument (" Distance must be greater than or equal to zero" );
510510 }
511511
512512 /* *
513- * Step to a different node in the network from given row and column.
513+ * Teleport to a different node in the network from given row and column.
514514 *
515515 * Returns any node of the nodes connected to the start node possibly based on the
516- * edge probability if probability was assigned to the edges.
516+ * edge probability if probability was assigned to the edges without considering
517+ * cost to travel from one node to the next one.
517518 *
518519 * If *num_steps* is greater than 1, multiple steps are perfomed and the last node
519520 * is returned. In each node, the probability of picking a specific connection is
@@ -526,12 +527,12 @@ class Network
526527 * was either checked beforehand or otherwise ensured. If there is no node, an
527528 * std::invalid_argument exception is thrown.
528529 * If there is more than one node at the given *row* and *column*, a random node is
529- * picked and used for traveling .
530+ * picked and used.
530531 *
531532 * @returns Destination row and column pair
532533 */
533534 template <typename Generator>
534- std::tuple<int , int > step (
535+ std::tuple<int , int > teleport (
535536 RasterIndex row, RasterIndex col, Generator& generator, int num_steps = 1 ) const
536537 {
537538 auto node_id = get_random_node_at (row, col, generator);
@@ -1092,7 +1093,7 @@ class Network
10921093 double ns_res_; // /< North-south resolution of the grid
10931094 RasterIndex max_row_; // /< Maximum row index in the grid
10941095 RasterIndex max_col_; // /< Maximum column index in the grid
1095- double distance_per_cell_; // /< Distance to travel through one cell (cost)
1096+ double distance_per_cell_; // /< Distance (cost) to walk through one cell
10961097 /* * Node IDs stored by row and column (multiple nodes per cell) */
10971098 std::map<std::pair<RasterIndex, RasterIndex>, std::set<NodeId>> nodes_by_row_col_;
10981099 NodeMatrix node_matrix_; // /< List of node neighbors by node ID (edges)
0 commit comments