Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hydraulicModel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘乐
hydraulicModel
Commits
f81d0b56
Commit
f81d0b56
authored
Oct 12, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,接口修改
parent
33c67f37
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
92 deletions
+5
-92
.gitignore
.gitignore
+2
-0
genetic.h
pandaAlgorithm/genetic.h
+1
-0
CivInpDbHelper.cpp
pandaDbManager/CivInpDbHelper.cpp
+2
-92
No files found.
.gitignore
View file @
f81d0b56
...
...
@@ -3,3 +3,5 @@
################################################################################
/.vs/hydraulicModel/v16
/temp/EPNAET2/x64/Release
/temp
pandaAlgorithm/genetic.h
View file @
f81d0b56
...
...
@@ -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
;
//变异率
...
...
pandaDbManager/CivInpDbHelper.cpp
View file @
f81d0b56
...
...
@@ -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
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment