Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Documents plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
DavoudTaghawiNejad committed Sep 5, 2017
1 parent 734ddfe commit 0687c64
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = E501
exclude = .git,__pycache__,docs/conf.py,old,build,dist

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Advanced
MultiCurrencyTrade
Quote
spatial
plugins

Graphical User Interface and Results
====================================
Expand Down
35 changes: 35 additions & 0 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Plugins
=======

ABCE has one plugin so far. The ABCESL accounting framework. If
you want to author your own plugin - its dead simple. All you
have to do is write a class that inherits from Agent in agent.py.
This class can overwrite::

def init(self, parameter, agent_parameter)
def _begin_subround(self):
def _end_subround(self):
def _advance_round(self, time):

For example like this::

class UselessAgent(abce.Agent):
def init(self, parameter, agent_parameter):
super().init()
print("Here i begin")

def _begin_subround(self):
super()._begin_subround()
print('subround begins')
print("its %r o'clock" % self.time)

def _end_subround(self):
super()._end_subround()
print('subround finishes')

def _advance_round(self, time):
super()._advance_round(time)
print('Super I made it to the next round')

def ability(self):
print("the simulation called my ability")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def build_extension(self, ext):
'bokeh == 0.12.7']


version = '0.8.2a1'
version = '0.8.2a5'


setup(name='abce',
Expand Down

0 comments on commit 0687c64

Please sign in to comment.