diff --git a/js/copasi.d.ts b/js/copasi.d.ts index f067cfd..173453f 100644 --- a/js/copasi.d.ts +++ b/js/copasi.d.ts @@ -75,16 +75,23 @@ export default class COPASI { simulateEx2D(startTime : number, endTime : number, numPoints : number) : number[][]; simulateYaml(yamlProcessingOptions : string|object) : SimResult; simulateYaml2D(yamlProcessingOptions : string|object) : SimResult; + getValue(nameOrId: string): number; + setValue(nameOrId: string, value: number): void; readonly floatingSpeciesConcentrations : number[]; readonly ratesOfChange : number[]; readonly floatingSpeciesNames : string[]; + readonly floatingSpeciesIds : string[]; readonly boundarySpeciesConcentrations : number[]; readonly boundarySpeciesNames : string[]; + readonly boundarySpeciesIds : string[]; readonly reactionNames : string[]; + readonly reactionIds : string[]; readonly reactionRates : number[]; readonly compartmentNames : string[]; + readonly compartmentIds : string[]; readonly compartmentSizes : number[]; readonly globalParameterNames : string[]; + readonly globalParameterIds : string[]; readonly globalParameterValues : number[]; readonly localParameterNames : string[]; readonly localParameterValues : number[]; diff --git a/js/copasi.js b/js/copasi.js index 4db89bb..c6f2d8c 100644 --- a/js/copasi.js +++ b/js/copasi.js @@ -40,6 +40,8 @@ class COPASI { this.oneStep = Module.oneStep; this.initCps = Module.initCps; this.destroy = Module.destroy; + this.getValue = Module.getValue; + this.setValue = Module.setValue; // init runtime this.initCps(); @@ -210,6 +212,13 @@ class COPASI { return this._vectorToArray(this.Module.getFloatingSpeciesNames()); } + /** + * @property {string[]} floatingSpeciesIds returns floating species ids + */ + get floatingSpeciesIds() { + return this._vectorToArray(this.Module.getFloatingSpeciesIds()); + } + /** * @property {number[]} boundarySpeciesConcentrations returns boundary species concentrations */ @@ -224,6 +233,13 @@ class COPASI { return this._vectorToArray(this.Module.getBoundarySpeciesNames()); } + /** + * @property {string[]} boundarySpeciesIds returns boundary species ids + */ + get boundarySpeciesIds() { + return this._vectorToArray(this.Module.getBoundarySpeciesIds()); + } + /** * @property {string[]} reactionNames returns reaction names */ @@ -231,6 +247,12 @@ class COPASI { return this._vectorToArray(this.Module.getReactionNames()); } + /** + * @property {string[]} reactionIds returns reaction ids + */ + get reactionIds() { + return this._vectorToArray(this.Module.getReactionIds()); + } /** * @property {number[]} reactionRates returns reaction rates */ @@ -245,6 +267,12 @@ class COPASI { return this._vectorToArray(this.Module.getCompartmentNames()); } + /** + * @property {string[]} compartmentIds returns compartment ids + */ + get compartmentIds() { + return this._vectorToArray(this.Module.getCompartmentIds()); + } /** * @property {number[]} compartmentSizes returns compartment sizes */ @@ -259,6 +287,12 @@ class COPASI { return this._vectorToArray(this.Module.getGlobalParameterNames()); } + /** + * @property {string[]} globalParameterIds returns global parameter ids + */ + get globalParameterIds() { + return this._vectorToArray(this.Module.getGlobalParameterIds()); + } /** * @property {number[]} globalParameterValues returns global parameter values */