Skip to content

Commit

Permalink
Merge pull request #833 from StochSS/jstree-cleanup
Browse files Browse the repository at this point in the history
Jstree cleanup
  • Loading branch information
seanebum authored Apr 30, 2020
2 parents 986e430 + 662d717 commit 576e045
Show file tree
Hide file tree
Showing 8 changed files with 388 additions and 633 deletions.
12 changes: 11 additions & 1 deletion client/models/simulation-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ module.exports = State.extend({
},
letUsChooseForYou: function () {
var defaultMode = this.parent.defaultMode;
if(defaultMode === "dynamic"){
var species = this.parent.species
var discreteSpecies = species.filter(function (specie) {
if(specie.mode === "discrete")
return specie
});
if(discreteSpecies.length === species.length)
defaultMode = "discrete"
}
var numEvents = this.parent.eventsCollection.length;
var numRules = this.parent.rules.length;
var numFuncDef = this.parent.functionDefinitions.length;
var tTol = this.tauTol
var aTol = this.absoluteTol
var rTol = this.relativeTol

if(numEvents || numRules || defaultMode !== 'discrete' || rTol !== 0.03 || aTol !== 0.03){
if(numEvents || numRules || numFuncDef || rTol !== 1e-3 || aTol !== 1e-6 || defaultMode !== 'discrete'){
this.algorithm = "Hybrid-Tau-Leaping";
}else if(tTol !== 0.03){
this.algorithm = "Tau-Leaping";
Expand Down
Loading

0 comments on commit 576e045

Please sign in to comment.