Example #1
0
//---------------------------------------------------------------------------
TestModel::TestModel(PluginManager* manager)
:
CPPPlugin(  "TestModel",                 "Examples",    NULL,    manager),  //Construct Base
//Properties
mModel(                         "",                     "Model",                    "A SBML model"),
mTestData(                      TelluriumData(),        "TestData",                 "Simulated Data"),
mTestDataWithNoise(             TelluriumData(),        "TestDataWithNoise",        "Simulated Data With Noise"),
mSigma(                         3.e-6,                  "Sigma",                    "Sigma (<=> size of applied noise)")
{
    mVersion = "1.0.0";
    //Setup the plugins properties
    mProperties.add(&mModel);
    mProperties.add(&mTestData);
    mProperties.add(&mTestDataWithNoise);

    mHint ="Get access to a SBML model, and simulated data using the model.";
    mDescription="The TestModel plugin exposes properties representing a simple SBML model and simulated data using the model. The purpose of this plugin is to give a client easy access to a test model \
as well as data to test with. \
The TestModel plugin was developed at the University of Washington by Totte Karlsson, 2012-2014.";

    //Load the model from file here..
    try
    {
        mModel.setValue(theModel);
    }
    catch(const exception& ex)
    {
        Log(lError)<<"There was a problem in the TestModel plugin: "<<ex.what();
    }
}
Example #2
0
AddNoise::AddNoise(rr::RoadRunner* aRR, PluginEvent fn1, PluginEvent fn2, PluginEvent fn3)
:
CPPPlugin(  "AddNoise",                 "Signal Processing",    aRR,    NULL),  //Construct Base
mNoiseType(         ntGaussian,         "NoiseType",   "Type of noise (Gaussian = 0)."),
mSigma(             1,                  "Sigma",       "Size of applied noise"),
mData(              TelluriumData(),    "InputData",   "Data on which noise will be applied to"),
mProgress(          0,                  "Progress",    "Indicate progress in (0-100%)"),
mAddNoiseWorker(*this)
{
    mVersion = "1.0.1";

    //Setup the plugins capabilities
    mProperties.add(&mNoiseType);
    mProperties.add(&mSigma);
    mProperties.add(&mData);

    mProperties.add(&mProgress);

    mHint ="Add Gaussian Noise to RoadRunner Data";
    mDescription="The AddNoise plugin adds Gaussian noise to synthetic data. The amount of noise is controlled \
by the plugins Sigma property. Specifically, noise is generated for each single data value, with a probability corresponding to a Gaussian distribution centered around the value, and with a variance equal to (sigma^2). \
The Plugin accepts Tellurium data as input, in the \"InputData\" property. \
Currently only Gaussian noise is supported. \
The progress of the application of noise can be read in the Progress property. \
Noise will not be generated onto the first column of data, if its column label is equal to \"Time\", (not case sensitive). \
The AddNoise plugin was developed at the University of Washington by Totte Karlsson, 2012-2014.";

    //The function below assigns property descriptions
    assignPropertyDescriptions();
}