Code Monkey home page Code Monkey logo

seeds's Introduction

SEEDS - Stochastic Ecological and Evolutionary Dynamics System

Created by

Brian Connelly <[email protected]> and Luis Zaman <[email protected]>

Website

https://github.com/briandconnelly/seeds

Expanded Documentation

The primary source for documentation is the SEEDS Wiki. Here, detailed installation instructions, how-to guides, code templates, and example experiments are provided.

Installing SEEDS

SEEDS requires Python version 2.7 or greater. As of version 1.0.9, SEEDS also supports Python 3. Additionally, SEEDS requires the NetworkX package.

Installation is done using the standard Python Distribution Utilities and can be as straightforward as running "python setup.py install". For further instructions on this process, please see the SEEDS Wiki or the official Distutils documentation at http://docs.python.org/install/index.html.

Running SEEDS

Out of the box, SEEDS includes simple experiments in the examples directory. These experiments can be run once SEEDS has been installed on your system. See the README.txt file in a specific directory to learn about the experiment, how to configure it, and how to perform it.

Expanding SEEDS

SEEDS is designed as a plugin-based framework. This means that you can create and use your own cell types, topologies, and actions and use these immediately without modifying the base SEEDS framework.

To create experiments that model behaviors of interest to you, a Cell type will need to be created. Additionally, sample Cell types can be found in the examples directory, and a template can be found in the templates directory.

For further information about plugins, please see the SEEDS Wiki.

Reporting Bugs and Feature Requests

SEEDS is under constant development. To see which features and changes are planned or to report bugs, visit http://github.com/briandconnelly/seeds/issues.

License

SEEDS is released under the Apache License, Version 2.0. For more information, see the files LICENSE.txt and NOTICE.txt.

seeds's People

Contributors

briandconnelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

seeds's Issues

Make the world an iterator?

Then programs like runseeds.py could just use that. Perhaps iter would return the epoch number.

This would update the population as long as proceed was true. At the end, teardown() could be called to do the cleanup.

Create a Well-Mixed topology

To allow experiments in traditional style well-mixed populations, create a well-mixed topology.

This could be done as either a graph with no edges. The topology would have to overwrite the basic Topology get_neighbors method and return a list of randomly-selected neighbors. The number of neighbors would be a parameter.

A second option would be a complete graph. This would also require a parameter to define the size of the neighbor list (pick a subset of the nodes randomly). The big downside is that this would prohibit large populations, as a complete graph takes a lot of time and memory.

header parameter for Actions

For those Actions which write files, specify whether or not to write a header row.

Actions that do not write files can ignore this option.

Remove Topology-, and Action-Managers. Use plugins.

Just like user plugins, the included Cells, Topologies, and Actions should be included in a system (i.e., installed where SEEDS is installed) plugins folder which is automatically appended/prepended to the plugin_dirs.

Bitstring Quasispecies Model

I'm on it...

This is what I'm thinking. We need a high but narrow peak, and a wide but lower second peak. Maybe 10 bits, the first 3 bits are the high but narrow peak, where having only these bits turned on allow you to be on the peak. Having 1 or 2 bits would be less fit than having 3, but any of the other 9 bits on would move you to a lower fitness. The other 6 bits could be additive and require you to not have any of the first 3 bits on. The highest fitness you can have in the 6 later bits would have to be less than having all 3 first bits on.

teardown functionality everywhere

Allow Actions, Cells, Topologies, and even Resources to execute a teardown() function.

Actions (e.g. WriteSnapshot) could have a write_on_teardown parameter that would write data at the end of a run.

Topology.get_neighbors() should take a cell instead of a node

It would be nice to ignore nodes entirely in the code, and if people need to get neighbors of a cell, for infection, or game theory stuffs, then you have to pass the node in. Instead we should pass a cell, and since the base Cell class knows its node, it can reliably access this variable and abstract the whole node business away.

De-Couple Resources from Nodes/Cells

Nodes represent organisms, and links between them represent potential interactions. Resources in the environment, however, don't need to follow those rules. Additionally, this allows Cells to create/remove/modify links by choice and still have the same environmental conditions.

Create a Game Theory Cell

Create a Cell type that would allow for Prisoner's Dilemma and Snowdrift like experiments. Configured parameters would be Temptation, Reward, Sucker's Payoff, and Punishment.

Generic Topologies for Resources or Population Interactions

To allow for Topologies in Resources and Populations and to prevent separate systems for both, topologies should simply create graphs. Resources or Populations could then take these graphs and add a Resource or Cell as an attribute, accordingly.

Cartesian Topology potential speedup

In the distance calculation, we calculate the square root every time we do a comparison. Instead pre-compute radius^2, and just compare to that. This is a constant speedup, but a fairly important constant. Also, it appears that math.sqrt() is about 7% slower than just calling "from math import sqrt()", not sure if its just some overhead in importing the package. Maybe python is smart enough to unroll the above comparison properly, I'm not sure, but its something work looking into.

Remove CellManager

Done. Still need to fix PrintCellTypeCount, which creates a cell in order to get the type names. May be a better way to do this. Perhaps create a self.cell_type_ref in World.

Stack trace from weird one time crash

Traceback (most recent call last):
File "runlettuce.py", line 116, in
main()
File "runlettuce.py", line 76, in main
world = L.World(configfile=cmd_options.configfile, seed=random_seed)
File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/lettuce/World.py", line 61, in init
self.topology_manager = TopologyManager(self)
File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/lettuce/TopologyManager.py", line 52, in init
t = CartesianTopology(self.world, topid)
File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/lettuce/topology/CartesianTopology.py", line 80, in init
periodic_boundaries=self.periodic_boundaries)
File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/lettuce/topology/CartesianTopology.py", line 148, in build_graph
p_coords = G.node[potential]['cell'].coords
KeyError: 537

Create a Misc or Tools file

Things that get used often like mean(), std(), etc. should be placed in a file that can be imported when used. This will cut down on duplication and hopefully make it easy for developers to find commonly-used functions.

Resource Actions

Add a set of actions to deal with Resources (in the generic sense), such as making them available or unavailable.

Option to include Experiment uuid to Actions

Add an option to Action to specify whether or not the Experiment's UUID should be included in CSV files. This would allow results from multiple Experiments to be concatenated.

This might also make parsing CSV files a little more tricky for scripts that do plotting, for example.

Signal Handling for runseeds.py

Allow runseeds.py to listen for kill signals or other signals used for preemption on queueing systems, and write a snapshot.

Potential print action idea

We could write a PrintPopulationAttributes and a PrintCellAttributes action, each which can register plugins that either take the population in and return a single (comma-free) value, or take a single cell in and returns a single value. The idea being you can have a single csv file that prints many population values (like cell types, average vals) and another csv that prints cell properties (like xy cords, type, prob of cooperation). This would probably cut back on some effort in writing some common types of print actions.

Data Writing Layer

Add a layer that would allow actions to seamlessly write to either a CSV file or to a sqlite database.

This would be implemented as a wrapper that writes in whichever way the configuration file says.

Ability to save distribution

Give runseeds.py the ability to create an archive of the version of SEEDS used and any plugins. This will greatly help in making data public, as it allows people to re-trace an experiment exactly.

Resource Types as Plugins

Instead of a few different predefined Resource types, make these plugins as well.

Open question: should all resources be based on a lattice, or should this be open? Pros/cons either way.

Additional Resource Types

In addition to a 'standard' resource type with inflow and outflow, add things like "sine" with period and amplitude and maybe "sawtooth".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.