Compare commits
No commits in common. "master" and "tutorials" have entirely different histories.
|
|
@ -3,7 +3,6 @@ jupyter notebook
|
|||
.ipynb_checkpoints
|
||||
.DS_Store
|
||||
.idea
|
||||
.pytest_cache/
|
||||
notebooks
|
||||
*.egg-info
|
||||
__pycache__
|
||||
|
|
@ -12,8 +11,10 @@ Pipfile.lock
|
|||
results
|
||||
.mypy_cache
|
||||
*.csv
|
||||
*.txt
|
||||
simulations/.ipynb_checkpoints
|
||||
simulations/validation/config3.py
|
||||
dist/*.gz
|
||||
cadCAD.egg-info
|
||||
|
||||
build
|
||||
|
|
|
|||
29
AUTHORS.txt
29
AUTHORS.txt
|
|
@ -1,29 +0,0 @@
|
|||
Authors
|
||||
=======
|
||||
|
||||
cadCAD was originally implemented by Joshua E. Jodesty and designed by Michael Zargham, Markus B. Koch, and
|
||||
Matthew V. Barlin from 2018 to 2019.
|
||||
|
||||
|
||||
Project Maintainers:
|
||||
- Joshua E. Jodesty <joshua@block.science, joshua.jodesty@gmail.com>
|
||||
- Markus B. Koch <markus@block.science>
|
||||
|
||||
|
||||
Contributors:
|
||||
- Joshua E. Jodesty
|
||||
- Markus B. Koch
|
||||
- Matthew V. Barlin
|
||||
- Michael Zargham
|
||||
- Zixuan Zhang
|
||||
- Charles Rice
|
||||
|
||||
|
||||
We’d also like to thank:
|
||||
- Andrew Clark
|
||||
- Nikhil Jamdade
|
||||
- Nick Hirannet
|
||||
- Jonathan Gabler
|
||||
- Chris Frazier
|
||||
- Harry Goodnight
|
||||
- Charlie Hoppes
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Contributing to cadCAD (Draft)
|
||||
|
||||
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
||||
|
||||
The following is a set of guidelines for contributing to cadCAD. These are mostly guidelines, not rules.
|
||||
Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
|
||||
### Pull Requests:
|
||||
|
||||
Pull Request (PR) presented as "->".
|
||||
|
||||
General Template:
|
||||
fork/branch -> BlockScience/staging
|
||||
|
||||
Contributing a new feature:
|
||||
fork/feature -> BlockScience/staging
|
||||
|
||||
Contributing to an existing feature:
|
||||
fork/feature -> BlockScience/feature
|
||||
|
||||
Thanks! :heart:
|
||||
21
LICENSE.txt
21
LICENSE.txt
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018-2019 BlockScience
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
170
README.md
170
README.md
|
|
@ -5,46 +5,162 @@
|
|||
/ /__/ /_/ / /_/ / /___/ ___ |/ /_/ /
|
||||
\___/\__,_/\__,_/\____/_/ |_/_____/
|
||||
by BlockScience
|
||||
======================================
|
||||
Complex Adaptive Dynamics
|
||||
o i e
|
||||
m d s
|
||||
p e i
|
||||
u d g
|
||||
t n
|
||||
e
|
||||
r
|
||||
```
|
||||
***cadCAD*** is a Python package that assists in the processes of designing, testing and validating complex systems through simulation, with support for Monte Carlo methods, A/B testing and parameter sweeping.
|
||||
|
||||
# Getting Started
|
||||
## 1. Installation:
|
||||
Requires [Python 3](https://www.python.org/downloads/)
|
||||
**Introduction:**
|
||||
|
||||
**Option A: Install Using [pip](https://pypi.org/project/cadCAD/)**
|
||||
***cadCAD*** is a Python library that assists in the processes of designing, testing and validating complex systems through
|
||||
simulation. At its core, cadCAD is a differential games engine that supports parameter sweeping and Monte Carlo analyses
|
||||
and can be easily integrated with other scientific computing Python modules and data science workflows.
|
||||
|
||||
**Description:**
|
||||
|
||||
cadCAD (complex adaptive systems computer-aided design) is a python based, unified modeling framework for stochastic
|
||||
dynamical systems and differential games for research, validation, and Computer Aided Design of economic systems created
|
||||
by BlockScience. It is capable of modeling systems at all levels of abstraction from Agent Based Modeling (ABM) to
|
||||
System Dynamics (SD), and enabling smooth integration of computational social science simulations with empirical data
|
||||
science workflows.
|
||||
|
||||
|
||||
An economic system is treated as a state-based model and defined through a set of endogenous and exogenous state
|
||||
variables which are updated through mechanisms and environmental processes, respectively. Behavioral models, which may
|
||||
be deterministic or stochastic, provide the evolution of the system within the action space of the mechanisms.
|
||||
Mathematical formulations of these economic games treat agent utility as derived from the state rather than direct from
|
||||
an action, creating a rich, dynamic modeling framework. Simulations may be run with a range of initial conditions and
|
||||
parameters for states, behaviors, mechanisms, and environmental processes to understand and visualize network behavior
|
||||
under various conditions. Support for A/B testing policies, Monte Carlo analysis, and other common numerical methods is
|
||||
provided.
|
||||
|
||||
|
||||
In essence, cadCAD tool allows us to represent a company’s or community’s current business model along with a desired
|
||||
future state and helps make informed, rigorously tested decisions on how to get from today’s stage to the future state.
|
||||
It allows us to use code to solidify our conceptualized ideas and see if the outcome meets our expectations. We can
|
||||
iteratively refine our work until we have constructed a model that closely reflects reality at the start of the model,
|
||||
and see how it evolves. We can then use these results to inform business decisions.
|
||||
|
||||
#### Documentation:
|
||||
* ##### [System Model Configuration](link)
|
||||
* ##### [System Simulation Execution](link)
|
||||
* ##### [Tutorials](link)
|
||||
|
||||
|
||||
#### 0. Installation:
|
||||
|
||||
**Option A:** Proprietary Build Access
|
||||
|
||||
***IMPORTANT NOTE:*** Tokens are issued to those with access to proprietary builds of cadCAD and BlockScience employees **ONLY**.
|
||||
Replace \<TOKEN\> with an issued token in the script below.
|
||||
```bash
|
||||
pip3 install cadCAD
|
||||
pip3 install cadCAD --extra-index-url https://<TOKEN>@repo.fury.io/blockscience/
|
||||
```
|
||||
|
||||
**Option B:** Build From Source
|
||||
```
|
||||
```bash
|
||||
pip3 install -r requirements.txt
|
||||
python3 setup.py sdist bdist_wheel
|
||||
pip3 install dist/*.whl
|
||||
```
|
||||
|
||||
|
||||
## 2. Learn the basics
|
||||
**Tutorials:** available both as [Jupyter Notebooks](tutorials)
|
||||
and [videos](https://www.youtube.com/watch?v=uJEiYHRWA9g&list=PLmWm8ksQq4YKtdRV-SoinhV6LbQMgX1we)
|
||||
#### 1. [Configure System Model](link)
|
||||
|
||||
Familiarize yourself with some system modelling concepts and cadCAD terminology.
|
||||
#### 2. [Execute Simulations:](link)
|
||||
|
||||
## 3. Documentation:
|
||||
* [System Model Configuration](documentation)
|
||||
* [System Simulation Execution](documentation/Simulation_Execution.md)
|
||||
* [Policy Aggregation](documentation/Policy_Aggregation.md)
|
||||
* [System Model Parameter Sweep](documentation/System_Model_Parameter_Sweep.md)
|
||||
##### Single Process Execution:
|
||||
Example [System Model Configurations](link):
|
||||
* [System Model A](link): `/documentation/examples/sys_model_A.py`
|
||||
* [System Model B](link): `/documentation/examples/sys_model_B.py`
|
||||
Example Simulation Executions:
|
||||
* [System Model A](link): `/documentation/examples/sys_model_A_exec.py`
|
||||
* [System Model B](link): `/documentation/examples/sys_model_B_exec.py`
|
||||
```python
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
from cadCAD.engine import ExecutionMode, ExecutionContext, Executor
|
||||
from documentation.examples import sys_model_A
|
||||
from cadCAD import configs
|
||||
|
||||
## 4. Connect
|
||||
Find other cadCAD users at our [Discourse](https://community.cadcad.org/). We are a small but rapidly growing community.
|
||||
exec_mode = ExecutionMode()
|
||||
|
||||
# Single Process Execution using a Single System Model Configuration:
|
||||
# sys_model_A
|
||||
sys_model_A = [configs[0]] # sys_model_A
|
||||
single_proc_ctx = ExecutionContext(context=exec_mode.single_proc)
|
||||
sys_model_A_simulation = Executor(exec_context=single_proc_ctx, configs=sys_model_A)
|
||||
|
||||
sys_model_A_raw_result, sys_model_A_tensor_field = sys_model_A_simulation.execute()
|
||||
sys_model_A_result = pd.DataFrame(sys_model_A_raw_result)
|
||||
print()
|
||||
print("Tensor Field: sys_model_A")
|
||||
print(tabulate(sys_model_A_tensor_field, headers='keys', tablefmt='psql'))
|
||||
print("Result: System Events DataFrame")
|
||||
print(tabulate(sys_model_A_result, headers='keys', tablefmt='psql'))
|
||||
print()
|
||||
```
|
||||
|
||||
### Multiple Simulations (Concurrent):
|
||||
##### Multiple Simulation Execution (Multi Process Execution)
|
||||
Documentation: [Simulation Execution](link)
|
||||
Example [System Model Configurations](link):
|
||||
* [System Model A](link): `/documentation/examples/sys_model_A.py`
|
||||
* [System Model B](link): `/documentation/examples/sys_model_B.py`
|
||||
[Example Simulation Executions::](link) `/documentation/examples/sys_model_AB_exec.py`
|
||||
```python
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
from cadCAD.engine import ExecutionMode, ExecutionContext, Executor
|
||||
from documentation.examples import sys_model_A, sys_model_B
|
||||
from cadCAD import configs
|
||||
|
||||
exec_mode = ExecutionMode()
|
||||
|
||||
# # Multiple Processes Execution using Multiple System Model Configurations:
|
||||
# # sys_model_A & sys_model_B
|
||||
multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)
|
||||
sys_model_AB_simulation = Executor(exec_context=multi_proc_ctx, configs=configs)
|
||||
|
||||
i = 0
|
||||
config_names = ['sys_model_A', 'sys_model_B']
|
||||
for sys_model_AB_raw_result, sys_model_AB_tensor_field in sys_model_AB_simulation.execute():
|
||||
sys_model_AB_result = pd.DataFrame(sys_model_AB_raw_result)
|
||||
print()
|
||||
print(f"Tensor Field: {config_names[i]}")
|
||||
print(tabulate(sys_model_AB_tensor_field, headers='keys', tablefmt='psql'))
|
||||
print("Result: System Events DataFrame:")
|
||||
print(tabulate(sys_model_AB_result, headers='keys', tablefmt='psql'))
|
||||
print()
|
||||
i += 1
|
||||
```
|
||||
|
||||
### Parameter Sweep Simulation (Concurrent):
|
||||
Documentation: [System Model Parameter Sweep](link)
|
||||
[Example:](link) `/documentation/examples/param_sweep.py`
|
||||
```python
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
# The following imports NEED to be in the exact order
|
||||
from cadCAD.engine import ExecutionMode, ExecutionContext, Executor
|
||||
from documentation.examples import param_sweep
|
||||
from cadCAD import configs
|
||||
|
||||
exec_mode = ExecutionMode()
|
||||
multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)
|
||||
run = Executor(exec_context=multi_proc_ctx, configs=configs)
|
||||
|
||||
for raw_result, tensor_field in run.execute():
|
||||
result = pd.DataFrame(raw_result)
|
||||
print()
|
||||
print("Tensor Field:")
|
||||
print(tabulate(tensor_field, headers='keys', tablefmt='psql'))
|
||||
print("Output:")
|
||||
print(tabulate(result, headers='keys', tablefmt='psql'))
|
||||
print()
|
||||
```
|
||||
|
||||
### Tests:
|
||||
```python
|
||||
python -m unittest testing/tests/param_sweep.py
|
||||
python -m unittest testing/tests/policy_aggregation.py
|
||||
python -m unittest testing/tests/historical_state_access.py
|
||||
python -m unittest testing/tests/external_dataset.py
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
Complex Adaptive Dynamics
|
||||
o i e
|
||||
m d s
|
||||
p e i
|
||||
u d g
|
||||
t n
|
||||
e
|
||||
r
|
||||
|
||||
__________ ____
|
||||
________ __ _____/ ____/ | / __ \
|
||||
/ ___/ __` / __ / / / /| | / / / /
|
||||
/ /__/ /_/ / /_/ / /___/ ___ |/ /_/ /
|
||||
\___/\__,_/\__,_/\____/_/ |_/_____/
|
||||
by BlockScience
|
||||
|
|
@ -47,8 +47,6 @@ def append_configs(sim_configs={}, initial_state={}, seeds={}, raw_exogenous_sta
|
|||
partial_state_update_blocks=partial_state_update_blocks,
|
||||
policy_ops=policy_ops
|
||||
)
|
||||
print(sim_configs)
|
||||
#for each sim config create new config
|
||||
configs.append(config)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -70,22 +70,11 @@ class Executor:
|
|||
config_proc = Processor()
|
||||
create_tensor_field = TensorFieldReport(config_proc).create_tensor_field
|
||||
|
||||
|
||||
print(r'''
|
||||
__________ ____
|
||||
________ __ _____/ ____/ | / __ \
|
||||
/ ___/ __` / __ / / / /| | / / / /
|
||||
/ /__/ /_/ / /_/ / /___/ ___ |/ /_/ /
|
||||
\___/\__,_/\__,_/\____/_/ |_/_____/
|
||||
by BlockScience
|
||||
''')
|
||||
print(f'Execution Mode: {self.exec_context + ": " + str(self.configs)}')
|
||||
print(f'Configurations: {self.configs}')
|
||||
|
||||
print(self.exec_context+": "+str(self.configs))
|
||||
var_dict_list, states_lists, Ts, Ns, eps, configs_structs, env_processes_list, partial_state_updates, simulation_execs = \
|
||||
[], [], [], [], [], [], [], [], []
|
||||
config_idx = 0
|
||||
|
||||
print(self.configs)
|
||||
for x in self.configs:
|
||||
|
||||
Ts.append(x.sim_config['T'])
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from pprint import pprint
|
||||
from typing import Any, Callable, Dict, List, Tuple
|
||||
from pathos.pools import ThreadPool as TPool
|
||||
from copy import deepcopy
|
||||
|
|
@ -169,6 +170,9 @@ class Executor:
|
|||
|
||||
time_step += 1
|
||||
|
||||
pprint(states_list)
|
||||
print()
|
||||
|
||||
return states_list
|
||||
|
||||
# state_update_pipeline
|
||||
|
|
@ -222,13 +226,10 @@ class Executor:
|
|||
|
||||
return first_timestep_per_run
|
||||
|
||||
tp = TPool(runs)
|
||||
pipe_run: List[List[Dict[str, Any]]] = flatten(
|
||||
tp.map(
|
||||
TPool().map(
|
||||
lambda run: execute_run(sweep_dict, states_list, configs, env_processes, time_seq, run),
|
||||
list(range(runs))
|
||||
)
|
||||
)
|
||||
|
||||
tp.clear()
|
||||
return pipe_run
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -50,10 +50,10 @@ def nonexistent(_params, substep, sH, s, _input):
|
|||
return 'nonexistent', access_block(sH, "nonexistent", 0, exclusion_list)
|
||||
```
|
||||
|
||||
#### [Example Simulation:](examples/historical_state_access.py)
|
||||
#### Example Simulation
|
||||
link
|
||||
|
||||
|
||||
#### Example Output:
|
||||
#### Example Output
|
||||
###### State History
|
||||
```
|
||||
+----+-------+-----------+------------+-----+
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ in the simulation. In other words, for how long do they want to simulate the sys
|
|||
|
||||
cadCAD facilitates running multiple simulations of the same system sequentially, reporting the results of all those
|
||||
runs in a single dataset. This is especially helpful for running
|
||||
[Monte Carlo Simulations](../tutorials/robot-marbles-part-4/robot-marbles-part-4.ipynb).
|
||||
[Monte Carlo Simulations](https://github.com/BlockScience/cadCAD-Tutorials/blob/master/01%20Tutorials/robot-marbles-part-4/robot-marbles-part-4.ipynb).
|
||||
|
||||
### M - Parameters of the System
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ cadCAD relies on in order to run the simulation according to the specifications.
|
|||
### Policy Functions
|
||||
A Policy Function computes one or more signals to be passed to [State Update Functions](#State-Update-Functions)
|
||||
(via the _\_input_ parameter). Read
|
||||
[this article](../tutorials/robot-marbles-part-2/robot-marbles-part-2.ipynb)
|
||||
[this article](https://github.com/BlockScience/cadCAD-Tutorials/blob/master/01%20Tutorials/robot-marbles-part-2/robot-marbles-part-2.ipynb)
|
||||
for details on why and when to use policy functions.
|
||||
|
||||
<!-- We would then expand the tutorials with these kind of concepts
|
||||
|
|
@ -218,7 +218,6 @@ append_configs(
|
|||
partial_state_update_blocks = PSUBs,
|
||||
...
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
#### Substep
|
||||
|
|
@ -238,4 +237,4 @@ Update Blocks)
|
|||
|
||||
Therefore, the total number of records in the resulting dataset is `N` x `T` x `len(partial_state_update_blocks)`
|
||||
|
||||
#### [System Simulation Execution](Simulation_Execution.md)
|
||||
#### [System Simulation Execution](https://github.com/BlockScience/cadCAD-Tutorials/blob/master/documentation/Simulation_Execution.md)
|
||||
|
|
@ -68,12 +68,12 @@ simulation_result = pd.DataFrame(raw_system_events)
|
|||
|
||||
### Execution Examples:
|
||||
##### Single Simulation Execution (Single Process Execution)
|
||||
Example System Model Configurations:
|
||||
* [System Model A](examples/sys_model_A.py): `/documentation/examples/sys_model_A.py`
|
||||
* [System Model B](examples/sys_model_B.py): `/documentation/examples/sys_model_B.py`
|
||||
Example [System Model Configurations](link):
|
||||
* [System Model A](link): `/documentation/examples/sys_model_A.py`
|
||||
* [System Model B](link): `/documentation/examples/sys_model_B.py`
|
||||
Example Simulation Executions:
|
||||
* [System Model A](examples/sys_model_A_exec.py): `/documentation/examples/sys_model_A_exec.py`
|
||||
* [System Model B](examples/sys_model_B_exec.py): `/documentation/examples/sys_model_B_exec.py`
|
||||
* [System Model A](link): `/documentation/examples/sys_model_A_exec.py`
|
||||
* [System Model B](link): `/documentation/examples/sys_model_B_exec.py`
|
||||
```python
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
|
|
@ -102,11 +102,11 @@ print()
|
|||
##### Multiple Simulation Execution
|
||||
|
||||
* ##### *Multi Process Execution*
|
||||
Documentation: Simulation Execution
|
||||
[Example Simulation Executions::](examples/sys_model_AB_exec.py) `/documentation/examples/sys_model_AB_exec.py`
|
||||
Example System Model Configurations:
|
||||
* [System Model A](examples/sys_model_A.py): `/documentation/examples/sys_model_A.py`
|
||||
* [System Model B](examples/sys_model_B.py): `/documentation/examples/sys_model_B.py`
|
||||
Documentation: [Simulation Execution](link)
|
||||
[Example Simulation Executions::](link) `/documentation/examples/sys_model_AB_exec.py`
|
||||
Example [System Model Configurations](link):
|
||||
* [System Model A](link): `/documentation/examples/sys_model_A.py`
|
||||
* [System Model B](link): `/documentation/examples/sys_model_B.py`
|
||||
```python
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
|
|
@ -134,9 +134,9 @@ for sys_model_AB_raw_result, sys_model_AB_tensor_field in sys_model_AB_simulatio
|
|||
i += 1
|
||||
```
|
||||
|
||||
* ##### [*System Model Parameter Sweep*](System_Model_Parameter_Sweep.md)
|
||||
|
||||
[Example:](examples/param_sweep.py) `/documentation/examples/param_sweep.py`
|
||||
* ##### *Parameter Sweep*
|
||||
Documentation: [System Model Parameter Sweep](link)
|
||||
[Example:](link) `/documentation/examples/param_sweep.py`
|
||||
```python
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
|
|
|
|||
|
|
@ -69,4 +69,5 @@ sim_config = config_sim(
|
|||
)
|
||||
```
|
||||
#### Example
|
||||
##### * [System Model Configuration](examples/param_sweep.py)
|
||||
##### * [System Model Configuration](https://github.com/BlockScience/cadCAD-Tutorials/blob/master/Documentation/examples/param_sweep.py)
|
||||
##### * Simulation Results:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,150 @@
|
|||
SOFTWARE LICENSE AGREEMENT
|
||||
|
||||
This Software License Agreement (the “Agreement”) is entered into as of December __ 2018, (the “Effective Date”) between
|
||||
Dapper Labs, Inc., a Canadian corporation having its principal place of business at 980-350 Howe Street,
|
||||
Vancouver, BC V6Z 1N9 (“DLI”) and BlockScience, Inc., a California corporation with an address at 471 McAuley Street,
|
||||
Oakland, CA 94609 (“BlockScience”). This Agreement includes the attached Exhibit A.
|
||||
|
||||
WHEREAS, DLI and BlockScience are parties to that certain Professional Services Agreement dated March 23, 2018 (the
|
||||
“PSA”), pursuant to which BlockScience performed and is currently performing professional services and other development
|
||||
work for DLI;
|
||||
|
||||
WHEREAS, as part of BlockScience’s performance under the PSA, BlockScience developed certain “behaviour archetypes” and
|
||||
“configuration of the Null Model”, which the parties agree are “Work Product” under the PSA;
|
||||
|
||||
WHEREAS, the parties agree that BlockScience’s proprietary SimCAD software tool is considered “Contractor Technology”
|
||||
under the PSA; and
|
||||
|
||||
WHEREAS, the parties wish to enter into this Agreement to clarify DLI’s rights to use the SimCAD software tool on a
|
||||
going-forward basis.
|
||||
|
||||
NOW, THEREFORE, for good and valuable consideration, the receipt and sufficiency of which is hereby acknowledged, DLI
|
||||
and BlockScience agree as follows:
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
(a) “Affiliate” means any entity that, directly or indirectly through one or more intermediaries, controls, is
|
||||
controlled by, or is under common control with, DLI.
|
||||
|
||||
(b) “Documentation” means any manuals, documentation and other supporting materials related to the Software.
|
||||
Documentation is considered part of the related Software.
|
||||
|
||||
(c) “Intellectual Property Rights” means patent rights (including patent applications and disclosures), copyrights,
|
||||
trade marks, trade secrets, know-how and any other intellectual property rights recognized in any country or
|
||||
jurisdiction in the world.
|
||||
|
||||
(d) “Software” means the object and source code versions of BlockScience’s proprietary SimCAD software product more
|
||||
fully described in Exhibit A. Software includes the applicable Documentation, as well as any Updates.
|
||||
|
||||
(e) “Update” means any bug fix, error correction, patch, modification, enhancement, update, upgrade, replacement,
|
||||
successor product, new version, new release, or derivative work of or to the Software.
|
||||
|
||||
(f) “Zeus” means the decentralized synchronous computational network developed by DLI, as such name or reference may be
|
||||
changed from time to time at DLI’s sole discretion.
|
||||
|
||||
2. SOFTWARE LICENSE
|
||||
|
||||
(a) License Grant. BlockScience hereby grants to DLI and its Affiliates a worldwide, non-exclusive, royalty-free,
|
||||
irrevocable, perpetual license to (i) download, install, use, execute, access, copy, perform, and modify, the Software
|
||||
in connection with the Zeus project; (ii) distribute and display the Software internally amongst DLI and its Affiliates,
|
||||
its and their employees, contractors, and agents, subject to the use of reasonable efforts to maintain the confidential
|
||||
status of the non-public aspects of the Software display; and (iii) create derivative works of the Software in
|
||||
connection with the Zeus project, provided that any such derivative works may only be used in connection with the Zeus
|
||||
project. For the sake of clarity, nothing in this Agreement (including, without limitation, this Section 2) will create
|
||||
any liability to DLI for or restrict DLI’s ability to externally distribute python scripts containing the “input”
|
||||
configuration files specific to the Zeus project, as well as the notebooks with the resulting “output” data from the
|
||||
Software, all of which may be distributed, displayed, and shared publicly at DLI’s discretion.
|
||||
|
||||
(b) Ownership; Limited Rights. As between the parties, BlockScience owns and retains all right, title and interest in
|
||||
and to the Software, and all Intellectual Property Rights therein. DLI’s rights in the Software are limited to those
|
||||
expressly granted in Section 2(a) and in the PSA. BlockScience reserves all rights and licenses in the Software not
|
||||
expressly granted to DLI herein and in the PSA.
|
||||
|
||||
(c) Delivery. BlockScience will deliver a copy of the Software and Documentation to DLI on the Effective Date. The
|
||||
delivery may be made in electronic form, or via hardcopy medium (e.g., a CD).
|
||||
|
||||
(d) Updates. BlockScience will deliver Updates to DLI as and when such Updates become available. The obligation to
|
||||
deliver Updates will continue for as long as the PSA remains in force; upon termination or expiration of the PSA,
|
||||
BlockScience’s obligation to provide Updates will automatically terminate.
|
||||
|
||||
(e) Support. BlockScience will provide reasonable technical support for the Software, to help DLI manage any support
|
||||
issues that arise. The obligation to provide support will continue for as long as the PSA remains in force; upon
|
||||
termination or expiration of the PSA, BlockScience’s obligation to provide support will automatically terminate.
|
||||
|
||||
3. NO FEES.
|
||||
|
||||
There are no fees owed by DLI for the license granted or the Updates or support provided by BlockScience
|
||||
pursuant to this Agreement. Each party will bear its own costs and expenses arising out of or relating to its
|
||||
obligations, efforts and performance under this Agreement.
|
||||
|
||||
4. LIMITED WARRANTY; DISCLAIMER
|
||||
|
||||
(a) Limited Warranty. BlockScience represents and warrants as follows: (i) that it has the right to enter into this
|
||||
Agreement, and to perform its obligations hereunder, without violating the terms of any other agreement; (ii) that the
|
||||
Software, and any Updates, do not and will not infringe, violate, or misappropriate the Intellectual Property Rights of
|
||||
any third party; (iii) that the Software and any Updates do not and will not contain any virus, malware, spyware, trojan
|
||||
horse, or other malicious code; and (iv) that the Software and each Update will substantially conform to its
|
||||
Documentation.
|
||||
|
||||
(b) Disclaimer. EXCEPT AS OTHERWISE SET FORTH IN THIS AGREEMENT, BLOCKSCIENCE DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR
|
||||
IMPLIED, RELATED TO THE SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
|
||||
PURPOSE.
|
||||
|
||||
5. TERM & TERMINATION
|
||||
|
||||
(a) Term. This Agreement begins on the Effective Date, and will continue in effect until one of us terminates it in
|
||||
accordance with Section 5(b).
|
||||
|
||||
(b) Termination for Breach. Either party may terminate this Agreement if the other party breaches any material term or
|
||||
condition of this Agreement, and the breaching party fails to cure the breach within thirty (30) days of receiving
|
||||
written notice of it.
|
||||
|
||||
(c) Survival. Sections 2 through 7 will survive termination or expiration of this Agreement.
|
||||
|
||||
6. INDEMNIFICATION.
|
||||
|
||||
BlockScience will defend, indemnify, and hold DLI harmless from and against any claim, damage, loss,
|
||||
liability, expense and cost (including, without limitation, reasonable attorneys’ fees) incurred by or brought against
|
||||
DLI arising out of or related to: (i) any claim that the Software infringes or misappropriates the Intellectual Property
|
||||
Rights of that third party; or (ii) BlockScience’s breach of its limited warranties in Section 4(a).
|
||||
|
||||
7. GENERAL TERMS
|
||||
|
||||
(a) Entire Agreement; Waiver. This Agreement is the entire understanding of the parties, and supersedes any and all
|
||||
prior agreements or understandings between the parties as to its subject matter. It may be amended or modified, or
|
||||
provisions waived, only in a writing signed by both parties. The waiver of a breach of any provision of this Agreement
|
||||
will not operate or be interpreted as a waiver of any other or subsequent breach.
|
||||
|
||||
(b) Acknowledgement. BlockScience acknowledges and agrees that the “behaviour archetypes” and “configuration of the Null
|
||||
Model” referenced in the PSA are considered “Work Product” under the PSA.
|
||||
|
||||
(c) Governing Law. This Agreement will be construed, interpreted and applies in accordance with the internal laws of
|
||||
British Columbia, Canada (excluding its body of law controlling conflicts of law). Any legal action or proceeding
|
||||
arising under or related to this Agreement will be brought exclusively in the federal or provincial courts located in
|
||||
Vancouver, British Columbia, and the parties irrevocably consent to personal jurisdiction and venue there.
|
||||
|
||||
(d) Severability. If any provision of this Agreement is held to be invalid or unenforceable for any reason, that
|
||||
provision will be enforced to the maximum extent permitted by law, and the remaining provisions will continue in full
|
||||
force and effect.
|
||||
|
||||
(e) Miscellaneous. This Agreement may be executed in one or more counterparts, with the same effect as if the parties
|
||||
had signed the same document. Each counterpart so executed will be deemed to be an original, and all such counterparts
|
||||
will be construed together and will constitute one Agreement. The prevailing party in any action or legal proceeding
|
||||
arising out of this Agreement will be entitled to recover from the other party all reasonable costs and expenses
|
||||
incurred in connection with such action or proceeding, including reasonable attorneys’ fees and court costs. In the
|
||||
event of a direct conflict between the terms of this Agreement and the PSA with respect to the DLI’s rights in and to
|
||||
the Software, the terms of this Agreement will control.
|
||||
|
||||
EXHIBIT A
|
||||
|
||||
SOFTWARE
|
||||
|
||||
Software Name: SimCAD tool
|
||||
|
||||
Software Description: SimCAD is a Monte-Carlo based simulation software package for research, validation, and
|
||||
Computer Aided Design of economic systems. An economic system is treated as a state based model and defined
|
||||
through a set of endogenous and exogenous state variables which are updated through mechanisms and
|
||||
environmental processes, respectively. Behavioral models, which may be deterministic or stochastic, provide the
|
||||
evolution of the system within the action space of the mechanisms. Simulations can be run with a range of initial
|
||||
conditions and parameters for states, behaviors, mechanisms, and environmental processes to understand and
|
||||
visualize network behavior under various conditions.
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
TRIAL LICENSE AGREEMENT
|
||||
|
||||
BACKGROUND
|
||||
|
||||
Company has developed and intends to market and license a certain software product and service called ”SimCAD” which,
|
||||
among other things, is a scientific engineering simulation tool (“Software”). Company wishes to provide access, on a
|
||||
trial basis, to users of a “beta” version of the Software to test and provide feedback to Company. Licensee wishes to
|
||||
participate in Company’s beta trial of the Software and to provide feedback to Company with respect to Licensee’s use
|
||||
thereof.
|
||||
|
||||
Accordingly, the parties hereby agree as follows:
|
||||
|
||||
1. BETA PRODUCT.
|
||||
|
||||
This Agreement applies to any prerelease version of the Software and any updates and changes thereto during the Term
|
||||
(collectively, “Beta Product”). As an essential condition of this Agreement, Licensee understands and acknowledges that:
|
||||
(a) Licensee is participating in a beta test of the Beta Product; (b) the Beta Product has not been field tested or
|
||||
trialed; and (c) the Beta Product may not operate properly or be error free and may not perform all functions for
|
||||
which it is intended or represented.
|
||||
|
||||
2. FEEDBACK.
|
||||
|
||||
As a condition of this Agreement, during the Term of this Agreement, Licensee agrees to provide Company with comments,
|
||||
feedback, criticisms, and suggestions for changes to the Beta Product (“Feedback”), and to help Company identify errors
|
||||
or malfunctions, and performance issues, in the operation of the Beta Product, as Company may reasonably request. All
|
||||
rights to any Feedback or other intellectual property derived from Licensee’s use of or relating to the Beta Product,
|
||||
as well any data collected from the use of the Beta Product, belong solely to Company and Licensee hereby irrevocably
|
||||
assigns all such rights to Company. Company reserves the right to use all Feedback and data collected as a result of the
|
||||
use of the Beta Product to advertise and promote the Company and the Software.
|
||||
|
||||
3. LICENSE AND RESERVATION OF RIGHTS.
|
||||
|
||||
3.1 Subject to the terms and conditions set forth in this Agreement, Company hereby grants Licensee, and Licensee
|
||||
accepts, during the Term, a nonexclusive, royaltyfree, revocable, nontransferable, limited license to access and use
|
||||
the Beta Product for its internal, noncommercial use for evaluation purposes only, and to give permission to employees
|
||||
of Licensee and employees of Licensee’s subsidiaries (“Permitted Users”) to use the Beta Product in accordance with the
|
||||
foregoing.
|
||||
|
||||
3.2 The Beta Product and the Software comprise the intellectual property of Company. All right, title and interest in
|
||||
and to the Beta Product (and, more generally, in and to the Software), and to all Feedback and data arising from its
|
||||
use, in whole or in part, and all patent, copyright, trademarks, trade secret and all other intellectual and industrial
|
||||
property rights therein and the structure, sequence and organization of same, and the media on which such material is
|
||||
contained belong exclusively to Company. Licensee and its Permitted Users will not, directly or indirectly: reverse
|
||||
engineer, decompile, disassemble or otherwise attempt to discover the source code, object code or underlying structure,
|
||||
ideas, knowhow or algorithms relevant to the Beta Product; modify, adapt, alter, edit, correct, translate, publish,
|
||||
sell, transfer, assign, convey, rent, lease, loan, pledge, sublicense, distribute, export, enhance or create derivative
|
||||
works based on the Beta Product; or remove, alter, cover or otherwise obscure any proprietary notices or labels
|
||||
displayed on or within the Beta Product any documentation relating thereto.
|
||||
|
||||
4. DISCLAIMER.
|
||||
|
||||
4.1 COMPANY MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, WITH RESPECT TO THE BETA PRODUCT,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE AVAILABILITY, QUALITY OR PERFORMANCE OF THE BETA PRODUCT. COMPANY SPECIFICALLY
|
||||
DISCLAIMS ALL EXPRESS, STATUTORY AND IMPLIED WARRANTIES AND CONDITIONS, INCLUDING, WITHOUT LIMITATION (A) THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, (B) ANY WARRANTIES AGAINST HIDDEN
|
||||
OR LATENT DEFECTS, (C) AND ANY WARRANTIES AND CONDITIONS ARISING OUT OF COURSE OF DEALING OR USAGE OF TRADE AND (D) ANY
|
||||
WARRANTY OR REPRESENTATION THAT THE BETA PRODUCT IS ERRORFREE, VIRUSFREE, SECURE, UNINTERRUPTED, OR FREE FROM
|
||||
UNAUTHORIZED ACCESS (INCLUDING, BUT NOT LIMITED TO, THIRD PARTY HACKERS OR DENIAL OF SERVICE ATTACKS). THE BETA PRODUCT
|
||||
IS SUPPLIED ON AN “AS IS”, “AS AVAILABLE” BASIS WITHOUT WARRANTY.
|
||||
|
||||
4.2 NEITHER PARTY SHALL BE LIABLE FOR SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR INDIRECT DAMAGES OR LOSS
|
||||
(INCLUDING DEATH AND PERSONAL INJURY), IRRESPECTIVE OF THEIR CAUSE, NOTWITHSTANDING THAT A PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH LOSS OR DAMAGE, NOR FOR ANY CLAIMS FOR SUCH LOSS OR DAMAGE INSTITUTED AGAINST A PARTY OR ITS
|
||||
CUSTOMERS BY ANY THIRD PARTY.
|
||||
|
||||
5. CONFIDENTIALITY
|
||||
|
||||
5.1 All Confidential Information disclosed by either party shall be kept by the receiving party in strict confidence and
|
||||
shall not be disclosed to any third party without the disclosing party’s express written consent. For purposes of this
|
||||
Agreement, “Confidential Information” means all information regarding either party’s business which has been marked or
|
||||
is otherwise communicated as being “proprietary” or “confidential” or which reasonably should be known by the receiving
|
||||
party to be proprietary or confidential information. Without limiting the generality of the foregoing, Confidential
|
||||
Information of Company includes nonpublic information regarding features, functionality and performance of the Beta
|
||||
Product, including all Feedback and related data. Notwithstanding the foregoing, each party’s confidentiality
|
||||
obligations hereunder shall not apply to information that: (a) is already known to the receiving party without a
|
||||
preexisting restriction as to disclosure; (b) is or becomes publicly available without fault of the receiving party;
|
||||
(c) is rightfully obtained by the receiving party from a third party without restriction as to disclosure, or is
|
||||
approved for release by written authorization of the disclosing party; (d) is developed independently by the receiving
|
||||
party without use of the disclosing party’s Confidential Information; or (e) is required to be disclosed by law or
|
||||
regulation, including, but not limited to, supplying such information or making such statements or disclosures relating
|
||||
to this Agreement before any competent court, governmental agency or authority in response to a lawful requirement or
|
||||
request from a court of governmental agency or authority, provided that the disclosing party shall give the other party
|
||||
prompt notice of such request, to the extent practicable, so that the other party may seek (at its sole cost and
|
||||
expense) an appropriate protective order or similar relief.
|
||||
|
||||
5.2 In the event of a breach of Sections 2, 3 or this Section 5, the nonbreaching party shall be entitled to seek
|
||||
equitable relief to protect its interests, including, but not limited to, injunctive relief. In the event of expiration
|
||||
or earlier termination of this Agreement, each party shall immediately return to the other party such other party’s
|
||||
Confidential Information, or at such other party’s option, destroy any remaining Confidential Information and certify
|
||||
that such destruction has taken place.
|
||||
|
||||
6. FEES; EXPENSES.
|
||||
|
||||
Neither party shall be entitled to any compensation in connection with this Agreement or its use or provision of the
|
||||
Beta Product. Each party shall bear its own costs and expenses arising from this Agreement and its use or provision of
|
||||
the Beta Product, as the case may be.
|
||||
|
||||
7. TERM OF AGREEMENT.
|
||||
|
||||
This Agreement shall begin on the Effective Date and shall continue until it has been terminated (such period, the
|
||||
“Term”). Either party shall have the right to terminate this Agreement at any time on one (1) month written notice to
|
||||
the other party, or in the case of a breach of this Agreement by Licensee or its Permitted Users, Company may terminate
|
||||
this Agreement immediately on written notice to Licensee. Upon termination of this Agreement, all rights granted to
|
||||
Licensee (and any Permitted User) under this Agreement will immediately terminate and Licensee (and all Permitted Users)
|
||||
must immediately cease all use of the Beta Product at such time. Notwithstanding any termination of this Agreement,
|
||||
Sections 2, 3.2, 4, 5, 6, this Section 7 and Section 8 shall survive and remain binding on the parties.
|
||||
|
||||
8. MISCELLANEOUS.
|
||||
|
||||
This Agreement shall be governed by and construed in accordance with the laws of the State of New York. All disputes
|
||||
relating to this Agreement shall be resolved in the federal and state courts of New York County, New York and the
|
||||
parties submit to the jurisdiction of such courts. This Agreement does not create any agency, partnership, or joint
|
||||
venture relationship between Licensee and Company. This Agreement is the entire understanding of the parties with
|
||||
respect to the subject matter hereof and supersedes any previous or contemporaneous communications, representations,
|
||||
warranties, discussions, arrangements or commitments, whether oral or written with respect to such subject matter. This
|
||||
Agreement cannot be amended except by a written amendment that expressly refers to this Agreement and is signed by an
|
||||
authorized representative of each party. This Agreement may be executed in one or more counterparts, including via
|
||||
facsimile or email (or any other electronic means such as “.pdf” or “.tiff” files), each of which shall be deemed an
|
||||
original, and all of which shall constitute one and the same Agreement.
|
||||
43
setup.py
43
setup.py
|
|
@ -1,38 +1,23 @@
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
long_description = """
|
||||
cadCAD (complex adaptive systems computer-aided design) is a python based, unified modeling framework for stochastic
|
||||
dynamical systems and differential games for research, validation, and Computer Aided Design of economic systems created
|
||||
by BlockScience. It is capable of modeling systems at all levels of abstraction from Agent Based Modeling (ABM) to
|
||||
System Dynamics (SD), and enabling smooth integration of computational social science simulations with empirical data
|
||||
science workflows.
|
||||
|
||||
An economic system is treated as a state-based model and defined through a set of endogenous and exogenous state
|
||||
variables which are updated through mechanisms and environmental processes, respectively. Behavioral models, which may
|
||||
be deterministic or stochastic, provide the evolution of the system within the action space of the mechanisms.
|
||||
Mathematical formulations of these economic games treat agent utility as derived from the state rather than direct from
|
||||
an action, creating a rich, dynamic modeling framework. Simulations may be run with a range of initial conditions and
|
||||
parameters for states, behaviors, mechanisms, and environmental processes to understand and visualize network behavior
|
||||
under various conditions. Support for A/B testing policies, Monte Carlo analysis, and other common numerical methods is
|
||||
provided.
|
||||
"""
|
||||
long_description = "cadCAD is a differential games based simulation software package for research, validation, and \
|
||||
Computer Aided Design of economic systems. An economic system is treated as a state based model and defined through \
|
||||
a set of endogenous and exogenous state variables which are updated through mechanisms and environmental processes, \
|
||||
respectively. Behavioral models, which may be deterministic or stochastic, provide the evolution of the system \
|
||||
within the action space of the mechanisms. Mathematical formulations of these economic games treat agent utility as \
|
||||
derived from state rather than direct from action, creating a rich dynamic modeling framework. Simulations may be \
|
||||
run with a range of initial conditions and parameters for states, behaviors, mechanisms, and environmental \
|
||||
processes to understand and visualize network behavior under various conditions. Support for A/B testing policies, \
|
||||
monte carlo analysis and other common numerical methods is provided."
|
||||
|
||||
setup(name='cadCAD',
|
||||
version='0.3.1',
|
||||
version='0.3.0',
|
||||
description="cadCAD: a differential games based simulation software package for research, validation, and \
|
||||
Computer Aided Design of economic systems",
|
||||
long_description=long_description,
|
||||
url='https://github.com/BlockScience/cadCAD',
|
||||
url='https://github.com/BlockScience/DiffyQ-SimCAD',
|
||||
author='Joshua E. Jodesty',
|
||||
author_email='joshua@block.science, joshua.jodesty@gmail.com',
|
||||
license='LICENSE.txt',
|
||||
packages=find_packages(),
|
||||
install_requires=[
|
||||
"pandas",
|
||||
"wheel",
|
||||
"pathos",
|
||||
"fn",
|
||||
"tabulate",
|
||||
"funcy"
|
||||
]
|
||||
author_email='joshua@block.science',
|
||||
# license='LICENSE',
|
||||
packages=find_packages()
|
||||
)
|
||||
|
|
@ -6,6 +6,5 @@ In this series, we introduce basic concepts of cadCAD and system modelling in ge
|
|||
[Part 3](robot-marbles-part-3/robot-marbles-part-3.ipynb) - From Synchronous to Asynchronous Time
|
||||
[Part 4](robot-marbles-part-4/robot-marbles-part-4.ipynb) - Uncertainty and Stochastic Processes
|
||||
[Part 5](robot-marbles-part-5/robot-marbles-part-5.ipynb) - Using class objects as state variables
|
||||
[Part 6](robot-marbles-part-6/robot-marbles-part-6.ipynb) - A/B testing
|
||||
|
||||
Check out the [videos](videos) folder for detailed walkthroughs of each one of the tutorials.
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue