libRoadRunner C API  1.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
RoadRunner C API Library

Introduction

RoadRunner is a SBML compliant high performance and portable simulation engine for systems and synthetic biology. To run a simple SBML model and generate time series data we would call:

main()
{
if (!loadSBMLFromFile (rrHandle, "mymodel.xml"))
exit();
result = simulate (0, 10, 100);
printf (rrDataToString (result));
return 0;
}

More complex example, using C API from C++:

#include <iostream>
#include <iomanip>
#include "rrc_api.h"
using namespace std;
using namespace rrc;
int main()
{
char* modelFile("../models/test_1.xml");
RRHandle rrHandle = createRRInstance();
if (!loadSBML(rrHandle, modelFile))
{
cout << "Error while loading SBML file\n";
cout << "Error message: "<< getLastError() <<endl;
exit(-1);
}
RRDataHandle output = simulateEx (rrHandle, 0, 10, 10); // start time, end time, and number of points
RRCData* cOutput = createRRCData(output);
int index = 0;
//Print out column headers.. typically time and species.
for(int col = 0; col < cOutput->CSize; col++)
{
cout<<setw(20)<<left<<cOutput->ColumnHeaders[index++];
if(col < cOutput->CSize -1)
{
cout<<"\t";
}
}
cout<<"\n";
index =0;
//Print out the data
for(int row = 0; row < cOutput->RSize; row++)
{
for(int col = 0; col < cOutput->CSize; col++)
{
cout<<setw(20)<<left<<cOutput->Data[index++];
if(col < cOutput->CSize -1)
{
cout<<"\t";
}
}
cout<<"\n";
}
//Cleanup
freeRRCData (cOutput);
freeRRInstance (rrHandle);
return 0;
}

Would create output like below

loading model file: ..\models\test_1.xml
Notice: Creating C based model generator using ..\compilers\tcc\tcc.exe compiler.
time [S1] [S2]
0 0.00015 0
1.11111 4.93788e-05 0.000100621
2.22222 1.62551e-05 0.000133745
3.33333 5.3511e-06 0.000144649
4.44444 1.76156e-06 0.000148238
5.55556 5.79896e-07 0.00014942
6.66667 1.90857e-07 0.000149809
7.77778 6.28294e-08 0.000149937
8.88889 2.05731e-08 0.000149979
10 6.74739e-09 0.000149993

Installation

Installation documentation is provided in the main google code page.

License

Copyright (C) 2012 University of Washington, Seattle, WA, USA

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In plain english this means:

You CAN freely download and use this software, in whole or in part, for personal, company internal, or commercial purposes;

You CAN use the software in packages or distributions that you create.

You SHOULD include a copy of the license in any redistribution you may make;

You are NOT required include the source of software, or of any modifications you may have made to it, in any redistribution you may assemble that includes it.

YOU CANNOT:

redistribute any piece of this software without proper attribution;