Skip to content

Changes to the python interface and the ability to set the seed of the RNG#17

Open
davidcsterratt wants to merge 83 commits into
lptolik:masterfrom
davidcsterratt:master
Open

Changes to the python interface and the ability to set the seed of the RNG#17
davidcsterratt wants to merge 83 commits into
lptolik:masterfrom
davidcsterratt:master

Conversation

@davidcsterratt

Copy link
Copy Markdown

There is quite a lot here, but the main change to the core is the Utils.setSeed() method. It would be great if this could be merged into your SpatialKappa fork

This is because with my hack to py4j the die_on_exit method doesn't
work because of the redirection of the stdout. In any case, this is
probably a neater method.
davidcsterratt and others added 30 commits November 7, 2018 17:06
* addVariableMap renamed to addVariable
* setTransitionRate renamed to setTransitionRateOrVariable
* setVariable removed, since setTransitionRateOrVariable does the job
* addVariable(String label, float input) created
* addVariable(Agent agent, String siteName, String linkName) removed
…atic model creation

The model and simulation are separate concepts in SpatialKappa, but
previously had reinitialised the simulation after changing a model. In
this refactoring the model is only initialised using initialiseSim()
and runForTime() or runUntilTime(). The interface is also made more
similar to the IKappaModel.
… times

Fix the issue by representing time as double rather than float. In
addition, if the time between events dt is more than 12 orders of
magnitude (i.e. 10^12) times smaller than the time t, throw an
exception. This ensures that there are at least 13 bits available to
represent dt, since the mantissa in a double has 53 bits, and
log2(10^12) (the maxiumum ratio between t and dt) is approximately 40
bits.
https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.2.3
The conversion of times to doubles didn't work for some situations, so
this change creates a local time within a time step in runByTime2(),
used in KappaNEURON. This reduces the likelihood of a precision error.
add jar file to fix python compilation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants