diff --git a/docs/jupyter_tutorial.html b/docs/jupyter_tutorial.html index 6860f570..8730e323 100644 --- a/docs/jupyter_tutorial.html +++ b/docs/jupyter_tutorial.html @@ -11810,7 +11810,7 @@

Interactive jupyter / I
-
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bokeh/util/deprecation.py:34: BokehDeprecationWarning: 
+
/Users/taghawi/Dropbox/workspace/abce/pypi093b0/lib/python3.6/site-packages/bokeh/util/deprecation.py:34: BokehDeprecationWarning: 
 The bokeh.charts API has moved to a separate 'bkcharts' package.
 
 This compatibility shim will remain until Bokeh 1.0 is released.
@@ -11857,9 +11857,11 @@ 

Creating the Agent
-
agents = simulation.build_agents(Agent, 'agent', 
-                                parameters={"world_size": 10}, 
-                                agent_parameters=['fred', 'astaire', 'altair', 'deurich'])
+
agents = simulation.build_agents(Agent, 'agent',
+                                 world_size=30,
+                                 agent_parameters=[{'family_name': 'fred'}, 
+                                                   {'family_name': 'astaire'}, 
+                                                   {'family_name': 'altair'}, 
+                                                   {'family_name': 'deurich'}])
 
+
+
+ + +
+ +
+ + +
+
30
+30
+30
+30
+
+
+
+ +
+
+

@@ -11985,8 +12011,8 @@

Giving a Good
class Kid(abce.Agent):
-    def init(self, parameters, agent_parameters):
-        self.num_kids = parameters['num_kids']
+    def init(self, num_kids):
+        self.num_kids = num_kids
         if self.id == 0:
             self.create('ball', 1)
         
@@ -12051,7 +12077,7 @@ 

Giving a Good
kids = simulation.build_agents(Kid, 'kid', number=num_kids,
-                                parameters={"num_kids": num_kids}) 
+                               num_kids=num_kids) 
                             
 
@@ -12153,8 +12179,8 @@

Trade

class NewKid(abce.Agent):
-    def init(self, parameters, agent_parameters):
-        self.num_dealers = parameters['num_dealers']
+    def init(self, num_dealers):
+        self.num_dealers = num_dealers
         self.create('money', 100)  # don't we all wish you'd this function in real live?
         
     def buy_drugs(self):
@@ -12187,7 +12213,7 @@ 

Trade

class DrugDealer(abce.Agent):
-    def init(self, parameters, agent_parameters):
+    def init(self):
         self.create('drugs', 1)
         
     def sell_to_customers(self):
@@ -12218,7 +12244,7 @@ 

Trade

In [14]:
-
simulation_parameters={'num_dealers': 1, 'num_customers': 1, 'rounds': 2}
+
num_dealers = 1
 
@@ -12244,7 +12270,7 @@

Trade

In [16]:
-
drug_dealers = simulation.build_agents(DrugDealer, 'drug_dealer', number=simulation_parameters['num_dealers'])
+
drug_dealers = simulation.build_agents(DrugDealer, 'drug_dealer', number=num_dealers)
 
@@ -12257,7 +12283,8 @@

Trade

In [17]:
-
customers = simulation.build_agents(NewKid, 'customer', number=simulation_parameters['num_customers'], parameters=simulation_parameters)
+
customers = simulation.build_agents(NewKid, 'customer', number=1, 
+                                   num_dealers=num_dealers)
 
@@ -12301,7 +12328,7 @@

Trade

In [19]:
-
for r in range(simulation_parameters['rounds']):
+
for r in range(2):
     simulation.advance_round(r)
     print('Customer offers 10 dollar:')
     customers.buy_drugs()
@@ -12328,18 +12355,18 @@ 

Trade

Round0
 Customer offers 10 dollar:
-    drug_dealer{'money': 0, 'drugs': 1.0}
+    drug_dealer{'drugs': 1.0}
     customer{'money': 90.0}
 Drug Dealer accepts or rejects the offer:
-    drug_dealer{'money': 0, 'drugs': 1.0}
+    drug_dealer{'drugs': 1.0}
     customer{'money': 100.0}
 
 Round1
 Customer offers 10 dollar:
-    drug_dealer{'money': 0, 'drugs': 1.0}
+    drug_dealer{'drugs': 1.0}
     customer{'money': 90.0}
 Drug Dealer accepts or rejects the offer:
-    drug_dealer{'money': 0, 'drugs': 1.0}
+    drug_dealer{'drugs': 1.0}
     customer{'money': 100.0}
 
 
@@ -12385,7 +12412,7 @@

Lets capture data
from math import sin
 
 class DataDealer(abce.Agent):
-    def init(self, simulation_parameters, agent_parameters):
+    def init(self):
         self.count = 0
         self.create('money', 0)
 
@@ -12455,7 +12482,7 @@ 

Lets capture datasimulation.advance_round(r) datadealers.counting() datadealers.agg_log(variables=['count']) - datadealers.panel_log(possessions=['money'], variables=['curve']) + datadealers.panel_log(goods=['money'], variables=['curve']) simulation.finalize()

@@ -12474,7 +12501,9 @@

Lets capture data -
Round0
+
+time only simulation   2.27
+Round0
 Round1
 Round2
 Round3
@@ -12491,14 +12520,6 @@ 

Lets capture dataLets capture dataLets capture data -
/Users/taghawi/Dropbox/workspace/abce_examples/examples/jupyter_tutorial/result/gatherdata_2017-09-05_08-05
+
/Users/taghawi/Dropbox/workspace/abce_examples/examples/jupyter_tutorial/result/gatherdata_2018-02-27_04-15
 

@@ -12671,10 +12698,10 @@

Lets capture data -
['aggregate_datadealer.csv',
+
['panel_datadealer.csv',
  'aggregated_datadealer.csv',
- 'description.txt',
- 'panel_datadealer.csv']
+ 'aggregate_datadealer.csv', + 'description.txt']

@@ -12754,18 +12781,18 @@

Using statistical software
- @@ -12974,7 +13001,7 @@

Using statistical software -
<matplotlib.axes._subplots.AxesSubplot at 0x10e723080>
+
<matplotlib.axes._subplots.AxesSubplot at 0x114f3b7b8>
@@ -12987,563 +13014,7 @@

Using statistical software - @@ -13573,7 +13044,7 @@

Communication between Simul
-
In [51]:
+
In [31]:
simulation = abce.Simulation()
@@ -13586,7 +13057,7 @@ 

Communication between Simul

-
In [52]:
+
In [32]:
class Communicator(abce.Agent):
@@ -13604,7 +13075,7 @@ 

Communication between Simul

-
In [53]:
+
In [33]:
communicators = simulation.build_agents(Communicator, 'communicator', number=3)
@@ -13614,10 +13085,30 @@ 

Communication between Simul

+
+
+ + +
+ +
+ + +
+
Warning: agent communicator has no init function
+Warning: agent communicator has no init function
+Warning: agent communicator has no init function
+
+
+
+ +
+
+
-
In [54]:
+
In [34]:
for time in range(3):
@@ -13670,19 +13161,6 @@ 

Communication between Simul

-
-
-
-
In [ ]:
-
-
-
 
-
- -
-
-
-