From: Rainer M. <ra...@tb...> - 2008-10-28 15:22:45
|
Hi Eric, In general, the IntegratorInstance_getVariableValue is the only way an external application is supposed to use to retrieve values from the model between IntegratorInstance_integrateOneStep calls. In the new version (CVS) this function also makes sure that the retrieved values are up-to-date (by evaluating assignment rules for values that might have changed)! Calling engine->data->value[i] directly is not considered save (although your way gave correct results!), and also such internal data structures might change with upcoming releases, while the interface function should stay the same! The observables array was used to optimize the updating of rules, i.e. to only update assignment rules required for a set of "observables", and thereby consider assignments that are already up-to-date. Since there is no restriction on ordering of rules in the new SBML version, the old approach wouldn't have worked that easily anymore. Also the observables could have let to _getVariableValue returning wrong values, if the user/application is not aware of the observables-requirement. Now this updating of remaining rules has been moved to _getVariableValue interface function, which only calls it once between _integrateOneStep and remembers that rules are up-to-date now. And for the vast majority of models there would be no increase in efficiency to restrict this update to a set of observables. Thus, efficiency-wise the observables array is not necessary anymore. You can just use _getVariableValue for any value you like. It is however a design decision. Do we want to provide direct access at least to data->value ? In that case, I could reintroduce the observables, which an application has to preset to make sure these are kept up-to-date independent of calling _getVariableValue. Opinions? Rainer On Mon, 27 Oct 2008, Eric Fernandez wrote: > Hi again :) > > I have a question regarding the recent CVS version. > > Before it was possible to filter out model parameters from model species > using : > > if (om->observablesArray[i]) { > fprintf(outfile, "%g ", engine->data->value[i]); > } > > but now the observablesArray has disappeared. How is it possible to get > an output equivalent to previous version? > > Thanks, > Eric > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > sbmlsolver-discuss mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-discuss > |