Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
52872185
Commit
52872185
authored
Apr 15, 2024
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 运行评价-干线方案评价增加拥堵指数
parent
0561b9a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
MainlineEvaluateServiceImpl.java
...t/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
+25
-0
StrategyAndMetricsEnum.java
...n/java/net/wanji/common/enums/StrategyAndMetricsEnum.java
+4
-2
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
View file @
52872185
...
...
@@ -1402,6 +1402,26 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
int
value
=
(
int
)
sumOfMax
;
curveElement
.
setValue
(
value
);
curveElementList
.
add
(
curveElement
);
}
}
else
if
(
Objects
.
equals
(
metricName
,
StrategyAndMetricsEnum
.
Metrics
.
TRAFFIC_INDEX
.
getDescription
()))
{
for
(
String
hourMinute
:
timeArray
)
{
MainlineSchemeEvaluateVO
.
CurveElement
curveElement
=
new
MainlineSchemeEvaluateVO
.
CurveElement
();
curveElement
.
setMetricTime
(
hourMinute
);
List
<
CrossDirDataHistPO
>
crossDirDataHistPOList
=
groupedByTime
.
get
(
hourMinute
);
double
sumOfAverages
=
crossDirDataHistPOList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
CrossDirDataHistPO:
:
getCrossId
))
.
entrySet
().
stream
()
.
mapToDouble
(
entry
->
entry
.
getValue
().
stream
()
.
mapToDouble
(
CrossDirDataHistPO:
:
getTrafficIndex
)
.
average
()
.
orElse
(
0.0
))
.
average
().
orElse
(
0.0
);
int
value
=
(
int
)
sumOfAverages
;
curveElement
.
setValue
(
value
);
curveElementList
.
add
(
curveElement
);
}
...
...
@@ -1747,6 +1767,11 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
metric7
.
setMetricName
(
StrategyAndMetricsEnum
.
Metrics
.
CORD_RELIABILITY
.
getDescription
());
metric7
.
setIsShown
(
0
);
res
.
add
(
metric7
);
MainlineSchemeAnalysisVO
.
Metric
metric9
=
new
MainlineSchemeAnalysisVO
.
Metric
();
metric9
.
setMetricName
(
StrategyAndMetricsEnum
.
Metrics
.
TRAFFIC_INDEX
.
getDescription
());
metric9
.
setIsShown
(
0
);
res
.
add
(
metric9
);
}
private
String
reverseDirName
(
String
input
,
String
character
)
{
...
...
wj-common/src/main/java/net/wanji/common/enums/StrategyAndMetricsEnum.java
View file @
52872185
...
...
@@ -51,7 +51,8 @@ public class StrategyAndMetricsEnum {
CORD_RELIABILITY
(
"15"
,
"协调方案可靠性"
,
"%"
,
"cordReliability"
),
CORD_QUEUE_RATIO
(
"16"
,
"协调路段排队空间占比"
,
"%"
,
"cordQueueRatio"
),
UNCOORDINATE_PHASE_QUEUE
(
"17"
,
"非协调相位二次排队"
,
"%"
,
"uncoordinatePhaseQueue"
),
TRVAL_TIME
(
"18"
,
"干线行程时间"
,
"s"
,
"trvalTime"
);
TRVAL_TIME
(
"18"
,
"干线行程时间"
,
"s"
,
"trvalTime"
),
TRAFFIC_INDEX
(
"19"
,
"拥堵指数"
,
""
,
"trafficIndex"
);
private
final
String
code
;
private
final
String
description
;
...
...
@@ -122,7 +123,8 @@ public class StrategyAndMetricsEnum {
Metrics
.
AVERAGE_DELAY
,
Metrics
.
MAX_QUEUE_LENGTH
,
Metrics
.
STOP_TIMES
,
Metrics
.
AVERAGE_SPEED
Metrics
.
AVERAGE_SPEED
,
Metrics
.
TRAFFIC_INDEX
));
map
.
put
(
Strategy
.
BALANCE
,
Arrays
.
asList
(
Metrics
.
GREEN_LIGHT_EFFICIENCY
,
...
...
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