-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defineEvent and defineInit? #316
Comments
Interesting. Could be good. A couple potential problems:
|
Thinking about this more, implementing If Does this make sense? |
In other words it provides a mechanism to "nest" the contents of sim$doEvent.module1Name()
sim$module1NameEvent1Name()
sim$module1NameEvent2Name()
sim$module1NameEvent3Name()
sim$doEvent.module2Name()
sim$module2NameEvent1Name()
sim$module2NameEvent2Name()
sim$module2NameEvent3Name()
sim$doEvent.module3Name()
sim$module3NameEvent1Name()
sim$module3NameEvent2Name()
sim$module3NameEvent3Name() we get this: sim$module1$doEvent()
sim$module1$Event1Name()
sim$module1$Event2Name()
sim$module1$Event3Name()
sim$module2$doEvent()
sim$module2$Event1Name()
sim$module2$Event2Name()
sim$module2$Event3Name()
sim$module3$doEvent()
sim$module3$Event1Name()
sim$module3$Event2Name()
sim$module3$Event3Name() |
Yes. This works. We can genericize the approach used in |
- moved `defineModule`, `defineParameter`, `expectsInput`, `createOutput` and related internal function definitions to separate file `moduleDefines.R` - move module parsing functions from `simulation.R` to `simulation-parseModule.R` - use `%>%` to split long (nested) lines - add package `stats` to sample caribou module
I've started a new feature branch for this ( |
made progress implementisng namespacing for module functions by redefining no changes are needed to module code, but see note re: use of still to do: implement the |
take a look at the |
This issue was moved to PredictiveEcology/SpaDES.core#19 |
@eliotmcintire
Is it worth restructuring modules to hide the
doEvent.modulename
and associatedif
/else
contructs and use adefineEvent
function instead?That makes the module structure MUCH simpler, and makes adding a new event very easy: just add a new
defineEvent
anywhere in the file.We can do something similar for the
.inputObjects
piece with adefineInit
.This would be a major structural change but would make module creation vastly easier for the user/developer.
The text was updated successfully, but these errors were encountered: