Exemplo n.º 1
0
//
//Saving the Neural network to an xml file
//
void NN_File::saveToFile(const std::string & fileName)
{
    TiXmlDocument doc;
    TiXmlElement * pRoot = new TiXmlElement("neuralnetwork");
    doc.LinkEndChild(pRoot);

    addStructure(pRoot);
    addWeights(pRoot);

    doc.SaveFile(fileName);
}
Exemplo n.º 2
0
bool TestModel::execute(bool inThread)
{
    Log(lDebug)<<"Executing the TestModel plugin by Totte Karlsson";
    RoadRunner rr;
    rr.load(mModel);

    rr::SimulateOptions opt;
    opt.start       = 0;
    opt.duration    = 10;
    opt.steps       = 14;

    TelluriumData data(rr.simulate(&opt));
    mTestData.setValue(data);

    //Add noise
    const PluginManager* PM = this->getPluginManager();
    Plugin* noise = PM->getPlugin("AddNoise");

    if(!noise)
    {
        stringstream msg;
        msg<<"The TestModel plugin dependes on the AddNoise plugin, which is not yet loaded.";

        throw(Exception(msg.str()));

    }
    mTestDataWithNoise.setValue(mTestData.getValue());

    noise->setPropertyValue("Sigma", mSigma.getValueHandle());
    noise->setPropertyValue("InputData", mTestDataWithNoise.getValueHandle());
    noise->execute();

    mTestDataWithNoise.setValue(noise->getPropertyValueHandle("InputData"));

    //Add weights
    addWeights();
    return true;
}
Exemplo n.º 3
0
//--------------------------------------------------------------
void ofxFatLine::add(const vector<ofVec3f> &thePoints, const vector<ofFloatColor> &theColors, const vector<double> &theWeights){
    addVertices(thePoints);
    addColors(theColors);
    addWeights(theWeights);
    update();
}