Comments (6)
Hope I am understanding that correctly. Say we are dealing with module health, why the function add_child! would be needed?
from loneparentsmodel.jl.
add_child! is obviously part of module Kinship. The problem is that a separate module Kinship would have to define add_child! without knowing in advance how that module will be incorporated into an agent. And forwarding every function a module defines from the agent type to the module type is annoying and error-prone.
from loneparentsmodel.jl.
I guess with some representative (psuode-)code, I could follow it better. So my understanding
module Kinship
...
add_child!(::Kinship) = ..
..
end # Ki
module Person
..
# you don't want add_child(::Person) here?
..
end # Person
from loneparentsmodel.jl.
Having
add_child!(p::Person) = add_child!(p.kinship)
would be the obvious way to handle these modules. However, I think that's not very satisfying since it means every function defined in any module has to be replicated in every definition of an agent type that uses that module.
from loneparentsmodel.jl.
Ok. You may want to propose if this is milestone V0.X or V{1,2}.X
from loneparentsmodel.jl.
Haven't tried it, but this looks like it might do exactly what we need: https://github.com/JeffreySarnoff/TypedDelegation.jl
from loneparentsmodel.jl.
Related Issues (20)
- Fuse all parameter types? HOT 1
- naming conventions var_name => varName
- Demography Data HOT 2
- keyword parameters HOT 2
- Model within mainHelper.jl HOT 19
- to place demographydata.jl within a module HOT 4
- implement income increments
- implement simple net migration
- selectMarraige HOT 1
- New Model API module HOT 4
- use newer age pyramid from UK for initialisation
- separate EconomyModel
- get rid of `struct *Data`
- make order and selection of processes run-time configurable
- add model docs to repo
- rethink state updates
- factor out classShares, ageBandShares
- get rid of getters/setters?
- try to reduce number of temporary vectors in jobmarket.jl
- make parameters patchable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loneparentsmodel.jl.