Network.
simulate_observations
(self, count, distribution='uniform')[source]¶Generate a simulated point pattern on the network.
The number of points to create or mean of the distribution if not ‘uniform’.
{'uniform', 'poisson'}
distribution of random points.
If "poisson"
, the distribution is calculated from half
the total network length.
Keys are the edge tuple. Values are lists of new point coordinates.
Examples
>>> import spaghetti as spgh
>>> ntw = spgh.Network(examples.get_path('streets.shp'))
>>> ntw.snapobservations(examples.get_path('crimes.shp'),
... 'crimes',
... attribute=True)
>>> npts = ntw.pointpatterns['crimes'].npoints
>>> sim = ntw.simulate_observations(npts)
>>> isinstance(sim, spgh.network.SimulatedPointPattern)
True