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
e7f03570
Commit
e7f03570
authored
Feb 17, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 优化绿波干线优化时间-逻辑优化版本
parent
4b0f54cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+13
-16
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
e7f03570
...
@@ -475,6 +475,13 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -475,6 +475,13 @@ public class StrategyControlServiceImpl implements StrategyControlService {
for
(
Map
.
Entry
<
Integer
,
List
<
StrategyGreenOptHistEntity
>>
entry
:
listMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
StrategyGreenOptHistEntity
>>
entry
:
listMap
.
entrySet
())
{
Integer
greenId
=
entry
.
getKey
();
Integer
greenId
=
entry
.
getKey
();
List
<
StrategyGreenOptHistEntity
>
value
=
entry
.
getValue
();
List
<
StrategyGreenOptHistEntity
>
value
=
entry
.
getValue
();
// 策略正常结束
StrategyGreenOptHistEntity
last
=
value
.
get
(
0
);
if
(
Objects
.
nonNull
(
last
)
&&
Objects
.
equals
(-
1
,
last
.
getControlMethod
()))
{
Date
parse
=
DateUtil
.
parse
(
last
.
getControlTime
(),
"yyyy-MM-dd HH:mm:ss"
);
long
controlLong
=
parse
.
getTime
();
endTime
=
controlLong
;
}
for
(
StrategyGreenOptHistEntity
entity
:
value
)
{
for
(
StrategyGreenOptHistEntity
entity
:
value
)
{
if
(
Objects
.
equals
(
0
,
entity
.
getDirType
()))
{
if
(
Objects
.
equals
(
0
,
entity
.
getDirType
()))
{
continue
;
continue
;
...
@@ -483,25 +490,15 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -483,25 +490,15 @@ public class StrategyControlServiceImpl implements StrategyControlService {
Integer
controlMethod
=
entity
.
getControlMethod
();
Integer
controlMethod
=
entity
.
getControlMethod
();
Date
parse
=
DateUtil
.
parse
(
controlTime
,
"yyyy-MM-dd HH:mm:ss"
);
Date
parse
=
DateUtil
.
parse
(
controlTime
,
"yyyy-MM-dd HH:mm:ss"
);
long
controlLong
=
parse
.
getTime
();
long
controlLong
=
parse
.
getTime
();
// 优化次数:去掉-1, 剩余记录总数
// 优化次数:去掉-1, 剩余记录总数 当前情况未考虑多次启动停止
long
temp
=
endTime
;
if
(!
Objects
.
equals
(-
1
,
controlMethod
))
{
if
(
Objects
.
equals
(-
1
,
controlMethod
))
{
endTime
=
parse
.
getTime
();
continue
;
}
else
{
greenOptCount
+=
1
;
greenOptCount
+=
1
;
// 最新数据与当前数据比较,小于30min
long
temp
=
endTime
;
if
(
endTime
-
controlLong
<
30
*
60
*
1000
)
{
temp
=
endTime
;
endTime
=
current
;
}
else
{
temp
=
endTime
;
endTime
=
controlLong
;
}
}
int
offset
=
(
int
)
((
temp
-
controlLong
)
/
1000
);
int
offset
=
(
int
)
((
temp
-
controlLong
)
/
1000
);
greenOptTime
+=
offset
;
greenOptTime
+=
offset
;
}
}
endTime
=
controlLong
;
}
}
}
}
}
strategyOptTimesVO
.
setCount
(
optCount
+
greenOptCount
);
strategyOptTimesVO
.
setCount
(
optCount
+
greenOptCount
);
...
...
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