1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
/*********************************************************************
MLDemos: A User-Friendly visualization toolkit for machine learning
Copyright (C) 2010 Basilio Noris
Contact: mldemos@b4silio.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License,
version 3 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*********************************************************************/
#include "interfaceDP.h"
#include <QPixmap>
#include <QBitmap>
#include <QPainter>
#include <datasetManager.h>
#include <canvas.h>
#include "reinforcementDP.h"
using namespace std;
ReinforcementInterfaceDP::ReinforcementInterfaceDP()
{
params = new Ui::ParametersDP();
params->setupUi(widget = new QWidget());
ChangeOptions();
}
ReinforcementInterfaceDP::~ReinforcementInterfaceDP()
{
delete params;
}
void ReinforcementInterfaceDP::ChangeOptions()
{
}
void ReinforcementInterfaceDP::SetParams(Reinforcement *reinforcement)
{
if(!reinforcement) return;
// double variance = params->varianceSpin->value();
// bool batchCheck= params->batchCheck->isChecked();
// ((ReinforcementDP *)reinforcement)->SetParams(variance*variance, batchCheck);
}
fvec ReinforcementInterfaceDP::GetParams(){return fvec();}
void ReinforcementInterfaceDP::SetParams(Reinforcement *reinforcement, fvec parameters){}
void ReinforcementInterfaceDP::GetParameterList(std::vector<QString> ¶meterNames,
std::vector<QString> ¶meterTypes,
std::vector< std::vector<QString> > ¶meterValues){}
Reinforcement *ReinforcementInterfaceDP::GetReinforcement()
{
Reinforcement *reinforcement = NULL;
reinforcement = new ReinforcementDP();
SetParams(reinforcement);
return reinforcement;
}
QString ReinforcementInterfaceDP::GetAlgoString()
{
// double variance = params->varianceSpin->value();
// bool batchCheck = params->batchCheck->isChecked();
// return QString("DP: %1 ").arg(variance) + (batchCheck ? "Batch" : "");
return "DP";
}
void ReinforcementInterfaceDP::SaveOptions(QSettings &settings)
{
// settings.setValue("varianceSpin", params->varianceSpin->value());
// settings.setValue("batchCheck", params->batchCheck->isChecked());
}
bool ReinforcementInterfaceDP::LoadOptions(QSettings &settings)
{
// if(settings.contains("varianceSpin")) params->varianceSpin->setValue(settings.value("varianceSpin").toFloat());
// if(settings.contains("batchCheck")) params->batchCheck->setChecked(settings.value("batchCheck").toBool());
return true;
}
void ReinforcementInterfaceDP::SaveParams(QTextStream &file)
{
// file << "maximizationOptions:" << "varianceSpin" << " " << params->varianceSpin->value() << "\n";
// file << "maximizationOptions:" << "batchCheck" << " " << params->batchCheck->isChecked() << "\n";
}
bool ReinforcementInterfaceDP::LoadParams(QString name, float value)
{
// if(name.endsWith("varianceSpin")) params->varianceSpin->setValue((float)value);
// if(name.endsWith("batchCheck")) params->batchCheck->setChecked((bool)value);
return true;
}
|