Commit f0508cd2 authored by Gerrit Erichsen's avatar Gerrit Erichsen
Browse files

Adding common.pri to make shared compiler flags available. Added...

Adding common.pri to make shared compiler flags available. Added USE_OPTIMIZATION as qmake config flag and HAS_OPTIMIZATION as a compiler flag in general
parent ee45309a
......@@ -6,12 +6,9 @@
#include <cmath>
#include <ctime>
//folgendes wieder Löschen
#include <QFile>
#include <QString>
#include <QStringList>
#include <QDebug>
//ende:folgendes wieder Löschen
#ifdef HAS_OPTIMIZATION
#include "OptimisationSchedule.h"
#endif
#include "InternalResult.h"
......@@ -376,6 +373,7 @@ void CharLAlgorithm::setGenericSolarCapacity(size_t node, double capacity)
void CharLAlgorithm::run()
{
#ifdef HAS_OPTIMIZATION
//tz - total optimisations in rooling horizon
m_optimisationLoopTotal = m_preferences->getNumberOfTimeSteps() / m_preferences->getNumberOfStepsForeCastPeriod();
......@@ -385,6 +383,7 @@ void CharLAlgorithm::run()
{
m_optimisationLoopTotal++;
}
#endif
//******************************************
if (m_preferences->doCalculatePowerFlow())
......@@ -397,6 +396,7 @@ void CharLAlgorithm::run()
for (int i = 0; i < m_preferences->getNumberOfTimeSteps(); i++)
{
#ifdef HAS_OPTIMIZATION
//tz - optimize forecast if sep is start of interval
if (i == (m_optimisationLoopCounter * m_preferences->getNumberOfStepsForeCastPeriod())
&& m_preferences->createOperationPlan() == true
......@@ -409,9 +409,9 @@ void CharLAlgorithm::run()
{
nStepsInterval = m_preferences->getNumberOfTimeSteps() - m_optimisationLoopCounter * m_preferences->getNumberOfStepsForeCastPeriod();
}
qDebug() << "CHARL: ### OptimisationLoop #" << m_optimisationLoopCounter + 1 << "-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|";
optimizeForecast(nStepsInterval);
}
#endif
//calculateStoragePower(i);
calculateVolatile(i);
......@@ -447,7 +447,6 @@ void CharLAlgorithm::run()
m_networks[j]->restart();
}
i = -1;
qDebug() << "->->->->->->->->->->Restart<-<-<-<-<-<-<-<-<-<-<-";
cout << "->->->->->->->->->->Restart<-<-<-<-<-<-<-<-<-<-<-";
}
}
......@@ -661,7 +660,7 @@ void CharLAlgorithm::calculateGrid(int step) //dv
}
clock_t end = clock();
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
qDebug() << "Elapsed: " << elapsed_secs;
cout << "Elapsed: " << elapsed_secs;
for (int i = 0; i < m_networks.size(); i++)
{
......
......@@ -27,7 +27,6 @@
#include "Network.h"
#include "Result.h"
#include "SimulationPreferences.h"
#include "OptimisationSchedule.h"
#include "Grid.h"
#include "EfficiencyField.h"
......
......@@ -10,12 +10,9 @@ QT -= gui
TARGET = CharLAlgorithm
TEMPLATE = lib
CONFIG += USE_CPLEX
#CONFIG += USE_GUROBI
include($$PWD/../common.pri)
DEFINES += CHARLALGORITHM_LIBRARY
DEFINES += HAS_CPLEX
#DEFINES += HAS_GUROBI
SOURCES += CharLAlgorithm.cpp \
EfficiencyField.cpp \
......@@ -59,44 +56,46 @@ unix {
INSTALLS += target
}
#CoinUtils
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/release/ -lCoinUtils
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/debug/ -lCoinUtils
else:unix: LIBS += -L$$PWD/../../libs/CoinUtils/ -lCoinUtils
INCLUDEPATH += $$PWD/../../libs/src/CoinUtils
DEPENDPATH += $$PWD/../../libs/src/CoinUtils
USE_OPTIMIZATION{
#CoinUtils
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/release/ -lCoinUtils
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/debug/ -lCoinUtils
else:unix: LIBS += -L$$PWD/../../libs/CoinUtils/ -lCoinUtils
INCLUDEPATH += $$PWD/../../libs/src/CoinUtils
DEPENDPATH += $$PWD/../../libs/src/CoinUtils
#Osi
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/Osi/release/ -lOsi
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/Osi/debug/ -lOsi
else:unix: LIBS += -L$$PWD/../../libs/Osi/ -lOsi
INCLUDEPATH += $$PWD/../../libs/src/Osi
DEPENDPATH += $$PWD/../../libs/src/Osi
#Osi
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/Osi/release/ -lOsi
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/Osi/debug/ -lOsi
else:unix: LIBS += -L$$PWD/../../libs/Osi/ -lOsi
INCLUDEPATH += $$PWD/../../libs/src/Osi
DEPENDPATH += $$PWD/../../libs/src/Osi
#FlopCpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/release/ -lFlopCpp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/debug/ -lFlopCpp
else:unix: LIBS += -L$$PWD/../../libs/FlopCpp/ -lFlopCpp
INCLUDEPATH += $$PWD/../../libs/src/FlopCpp
DEPENDPATH += $$PWD/../../libs/src/FlopCpp
#FlopCpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/release/ -lFlopCpp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/debug/ -lFlopCpp
else:unix: LIBS += -L$$PWD/../../libs/FlopCpp/ -lFlopCpp
INCLUDEPATH += $$PWD/../../libs/src/FlopCpp
DEPENDPATH += $$PWD/../../libs/src/FlopCpp
#GLPK
LIBS += -L$$PWD/../../libs/winglpk-4.47/glpk-4.47/w64/ -lglpk_4_47
INCLUDEPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
DEPENDPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
#GLPK
LIBS += -L$$PWD/../../libs/winglpk-4.47/glpk-4.47/w64/ -lglpk_4_47
INCLUDEPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
DEPENDPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
#CPLEX
USE_CPLEX{
LIBS += -L'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/lib/x64_windows_vs2013/stat_mda/' -lcplex1271 -lilocplex
INCLUDEPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
DEPENDPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
}
#CPLEX
USE_CPLEX{
LIBS += -L'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/lib/x64_windows_vs2013/stat_mda/' -lcplex1271 -lilocplex
INCLUDEPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
DEPENDPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
}
#GUROBI
USE_GUROBI{
LIBS += -L'C:/gurobi702/win64/lib' -lgurobi_c++md2013 -lgurobi70
INCLUDEPATH += 'C:/gurobi702/win64/include'
DEPENDPATH += 'C:/gurobi702/win64/include'
#GUROBI
USE_GUROBI{
LIBS += -L'C:/gurobi702/win64/lib' -lgurobi_c++md2013 -lgurobi70
INCLUDEPATH += 'C:/gurobi702/win64/include'
DEPENDPATH += 'C:/gurobi702/win64/include'
}
}
#Eigen
......
......@@ -11,9 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = CharL_GUI
TEMPLATE = app
CONFIG += USE_CPLEX
#CONFIG += USE_GUROBI
include($$PWD/../common.pri)
SOURCES += main.cpp\
CharLGui.cpp \
......@@ -101,44 +99,46 @@ DEPENDPATH += $$PWD/../CharLAlgorithm
#Eigen
INCLUDEPATH += $$PWD/../../libs/src/Eigen3/Eigen
#CoinUtils
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/release/ -lCoinUtils
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/debug/ -lCoinUtils
else:unix: LIBS += -L$$PWD/../../libs/CoinUtils/ -lCoinUtils
INCLUDEPATH += $$PWD/../../libs/src/CoinUtils
DEPENDPATH += $$PWD/../../libs/src/CoinUtils
#Osi
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/Osi/release/ -lOsi
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/Osi/debug/ -lOsi
else:unix: LIBS += -L$$PWD/../../libs/Osi/ -lOsi
INCLUDEPATH += $$PWD/../../libs/src/Osi
DEPENDPATH += $$PWD/../../libs/src/Osi
#FlopCpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/release/ -lFlopCpp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/debug/ -lFlopCpp
else:unix: LIBS += -L$$PWD/../../libs/FlopCpp/ -lFlopCpp
INCLUDEPATH += $$PWD/../../libs/src/FlopCpp
DEPENDPATH += $$PWD/../../libs/src/FlopCpp
#GLPK
LIBS += -L$$PWD/../../libs/winglpk-4.47/glpk-4.47/w64/ -lglpk_4_47
INCLUDEPATH += $$PWD/../libs/winglpk-4.47/glpk-4.47/src
DEPENDPATH += $$PWD/../libs/winglpk-4.47/glpk-4.47/src
#CPLEX
USE_CPLEX{
LIBS += -L'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/lib/x64_windows_vs2013/stat_mda/' -lcplex1271 -lilocplex
INCLUDEPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
DEPENDPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
}
#GUROBI
USE_GUROBI{
LIBS += -L'C:/gurobi702/win64/lib' -lgurobi_c++md2013 -lgurobi70
INCLUDEPATH += 'C:/gurobi702/win64/include'
DEPENDPATH += 'C:/gurobi702/win64/include'
USE_OPTIMIZATION{
#CoinUtils
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/release/ -lCoinUtils
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/debug/ -lCoinUtils
else:unix: LIBS += -L$$PWD/../../libs/CoinUtils/ -lCoinUtils
INCLUDEPATH += $$PWD/../../libs/src/CoinUtils
DEPENDPATH += $$PWD/../../libs/src/CoinUtils
#Osi
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/Osi/release/ -lOsi
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/Osi/debug/ -lOsi
else:unix: LIBS += -L$$PWD/../../libs/Osi/ -lOsi
INCLUDEPATH += $$PWD/../../libs/src/Osi
DEPENDPATH += $$PWD/../../libs/src/Osi
#FlopCpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/release/ -lFlopCpp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/debug/ -lFlopCpp
else:unix: LIBS += -L$$PWD/../../libs/FlopCpp/ -lFlopCpp
INCLUDEPATH += $$PWD/../../libs/src/FlopCpp
DEPENDPATH += $$PWD/../../libs/src/FlopCpp
#GLPK
LIBS += -L$$PWD/../../libs/winglpk-4.47/glpk-4.47/w64/ -lglpk_4_47
INCLUDEPATH += $$PWD/../libs/winglpk-4.47/glpk-4.47/src
DEPENDPATH += $$PWD/../libs/winglpk-4.47/glpk-4.47/src
#CPLEX
USE_CPLEX{
LIBS += -L'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/lib/x64_windows_vs2013/stat_mda/' -lcplex1271 -lilocplex
INCLUDEPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
DEPENDPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
}
#GUROBI
USE_GUROBI{
LIBS += -L'C:/gurobi702/win64/lib' -lgurobi_c++md2013 -lgurobi70
INCLUDEPATH += 'C:/gurobi702/win64/include'
DEPENDPATH += 'C:/gurobi702/win64/include'
}
}
RESOURCES += \
......
#CONFIG += USE_OPTIMIZATION
USE_OPTIMIZATION{
DEFINES += HAS_OPTIMIZATION
CONFIG += USE_CPLEX
#CONFIG += USE_GUROBI
}
USE_CPLEX{
DEFINES += HAS_CPLEX
}
USE_GUROBI{
DEFINES += HAS_GUROBI
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment