cppyabm  1.0.17
An agent-based library to integrate C++ and Python
binds.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "cppyabm/mesh.h"
3 #include "cppyabm/bind_tools.h"
4 #include "cppyabm/common.h"
5 #include "cppyabm/bases.h"
6 struct expEnv;
7 struct expPatch;
8 struct expAgent;
9 struct expEnv: public Env<expEnv,expAgent,expPatch>{
10 };
11 struct expAgent: public Agent<expEnv,expAgent,expPatch>{
12  expAgent(shared_ptr<expEnv> env , string class_name):Agent<expEnv,expAgent,expPatch>(env,class_name){
13 
14  }
15 };
16 struct expPatch: public Patch<expEnv,expAgent,expPatch>{
17  expPatch(shared_ptr<expEnv> env, MESH_ITEM mesh_item):Patch<expEnv,expAgent,expPatch>(env,mesh_item){}
18 };
19 
22 
23 PYBIND11_MODULE(binds, m) {
24  bind_tools::expose_defaults<expEnv,expAgent,expPatch>(m);
25  bind_tools::expose_env<expEnv,expAgent,expPatch,bind_tools::tramEnv<expEnv,expAgent,expPatch>>(m,"Env");
26  bind_tools::expose_agent<expEnv,expAgent,expPatch,bind_tools::tramAgent<expEnv,expAgent,expPatch>>(m,"Agent");
27  bind_tools::expose_patch<expEnv,expAgent,expPatch,bind_tools::tramPatch<expEnv,expAgent,expPatch>>(m,"Patch");
28 }
29 
expPatch::expPatch
expPatch(shared_ptr< expEnv > env, MESH_ITEM mesh_item)
Definition: binds.cpp:17
EXPOSE_AGENT_CONTAINER
EXPOSE_AGENT_CONTAINER(expAgent)
PYBIND11_MODULE
PYBIND11_MODULE(binds, m)
Definition: binds.cpp:23
EXPOSE_PATCH_CONTAINER
EXPOSE_PATCH_CONTAINER(expPatch)
expAgent
Definition: binds.cpp:11
expEnv
Definition: binds.cpp:9
Patch
Base class for patch.
Definition: bases.h:28
expPatch
Definition: binds.cpp:16
MESH_ITEM
A class for mesh items.
Definition: mesh.h:10
Agent
Base class for Agent.
Definition: bases.h:103
Agent< expEnv, expAgent, expPatch >::class_name
string class_name
Unique ID of this class.
Definition: bases.h:136
expAgent::expAgent
expAgent(shared_ptr< expEnv > env, string class_name)
Definition: binds.cpp:12
env
Definition: env.py:1
Env
Base class for environment.
Definition: bases.h:145
test_async.m
m
Definition: test_async.py:5