# Sites information ------------------------------------------------------------
pts = (
(0.0, 0.0, 0),
(2.0, 0.5, 0),
(2.5, 1.5, 0),
)
points = pd.DataFrame(pts, columns=('x', 'y', 't'))
# Traps settings ---------------------------------------------------------------
trp = (
(2.5, 0.75, 0, 0),
(0.0, 0.50, 0, 0)
)
traps = pd.DataFrame(trp, columns=('x', 'y', 't', 'f'))
tKernels = {0: {'kernel': srv.exponentialDecay, 'params': {'A': 0.5, 'b': 3}}}
# Generating and using landscape -----------------------------------------------
lnd = srv.Landscape(points, traps=traps, trapsKernels=tKernels)
lnd.calcFundamentalMatrix()
fitness = lnd.getDaysTillTrapped()
(fig, ax) = plt.subplots(figsize=(15, 15))
lnd.plotSites(fig, ax)
lnd.plotMigrationNetwork(fig, ax)
lnd.plotTraps(fig, ax)
lnd.plotTrapsNetwork(fig, ax)
fig.show()
Héctor M. Sánchez C.
John Marshall, David L. Smith
(sanchez.hmsc@berkeley.edu | chipdelmal.github.io)
Thanks to Conversations with: Tomas León, Jared Bennett, Sean L. Wu, Eileen Jeffrey, Elijah Bartolome, Chris De Leon, Gaming Friends