Commit f81d0b56 authored by 刘乐's avatar 刘乐

1,接口修改

parent 33c67f37
......@@ -3,3 +3,5 @@
################################################################################
/.vs/hydraulicModel/v16
/temp/EPNAET2/x64/Release
/temp
......@@ -67,7 +67,7 @@ public:
// 杂焦虑
double crossoverRate() const { return mCrossoverRate; }
double selectRate() const { return mSelectRate; }
double selectRate() const { return mSelectRate; }
double variationRate() const { return mVariationRate; }
private:
......@@ -76,6 +76,7 @@ private:
int mIrangeR = 2;
int mLength = 22; // 二进制编码长度
int mIteration = 10000; // 迭代次数
double mCrossoverRate = 0.7; // 杂交率
double mSelectRate = 0.5; // 选择率
double mVariationRate = 0.001; //变异率
......
......@@ -42,34 +42,9 @@ bool CivInpDbHelper::getNode(CivNode& node)
std::string patternID = map.find(nodeTableFields.demandPattern)->second;
std::string demand = map.find(nodeTableFields.baseDemand)->second;
// 处理延时模拟情况
handleDelayPattern(demand, patternID, nodeTable.Demand, nodeTable.PatternId);
//// 是否做延时模拟
//if (isDelayTime)
//{
// nodeTable.Demand = demand;
// nodeTable.PatternId = patternID;
//}
//else
//{
// auto iter = mPatterns.find(patternID);
// if (iter != mPatterns.end())
// {
// std::vector<std::string> mulitiers = iter->second;
// if (mPatternTime > mulitiers.size())
// mPatternTime = mulitiers.size() - 1;
// if (mPatternTime < 0)
// mPatternTime = 0;
// std::string mulitier = mulitiers[mPatternTime];
// float intMul = std::atof(mulitier.c_str());
// float dem = std::atof(demand.c_str());
// demand = std::to_string(dem * intMul);
// nodeTable.Demand = demand;
// }
//}
node.addItem(nodeTable);
}
......@@ -169,41 +144,6 @@ bool CivInpDbHelper::getTank(CivTank& tanks)
bool CivInpDbHelper::getValve(CivValve& valves)
{
/*ValveTable vaveTable;
std::vector<std::string> fields;
fields.push_back(vaveTable.sn);
fields.push_back(vaveTable.startPoint);
fields.push_back(vaveTable.endPoint);
fields.push_back(vaveTable.length);
fields.push_back(vaveTable.type);
fields.push_back(vaveTable.setting);
fields.push_back(vaveTable.lossCoeff);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(VALVE, fields, resultVector, mCondtion);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
{
CivValve::ValveTable vave;
std::map<std::string, std::string> map = resultVector[i];
std::string vaType = map.find(vaveTable.type)->second;
if (vaType == "BV")
continue;
vave.ID = map.find(vaveTable.sn)->second;
vave.Node1 = map.find(vaveTable.startPoint)->second;
vave.Node2 = map.find(vaveTable.endPoint)->second;
vave.Diameter = map.find(vaveTable.length)->second;
vave.Type = map.find(vaveTable.type)->second;
vave.Setting = map.find(vaveTable.setting)->second;
vave.MinorLoss = map.find(vaveTable.lossCoeff)->second;
valves.addItem(vave);
}*/
size_t size = mValuvesVec.size();
for (int i = 0; i < size; i++)
{
......@@ -361,36 +301,6 @@ bool CivInpDbHelper::getQuality(CivQuality& quality)
bool CivInpDbHelper::getStatus(CivStatus& status)
{
//ValveTable vaTable;
//std::vector<std::string> fields;
//fields.push_back(vaTable.sn);
//fields.push_back(vaTable.fixedState);
//fields.push_back(vaTable.type);
//std::vector<std::map<std::string, std::string>> resultVector;
//mDbConn->query(VALVE, fields, resultVector);
//size_t total = resultVector.size();
//for (int i = 0; i < total; i++)
//{
// CivStatus::StatusTable statTable;
// auto resMap = resultVector[i];
//
// std::string state = resMap.find(vaTable.fixedState)->second;
// std::string type = resMap.find(vaTable.type)->second;
// std::transform(state.begin(), state.end(), state.begin(), ::toupper);
// if (type == "BV")
// continue;
// statTable.ID = resMap.find(vaTable.sn)->second;
// statTable.Setting = state;
// status.addItem(statTable);
//}
// 阀门状态值,
size_t statuSize = mStatusVec.size();
for (int i = 0; i < statuSize; i++)
......
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