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
67f79247
Commit
67f79247
authored
Jan 31, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 优化模块引入feign远程调用;实时检测-路口失衡优化
parent
644f8018
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
224 additions
and
61 deletions
+224
-61
pom.xml
signal-optimize-service/pom.xml
+7
-1
CrossTurnDataRealtimeDTO.java
...main/java/net/wanji/opt/dto/CrossTurnDataRealtimeDTO.java
+43
-17
CrossOptimizeServiceImpl.java
.../net/wanji/opt/service/impl/CrossOptimizeServiceImpl.java
+174
-43
No files found.
signal-optimize-service/pom.xml
View file @
67f79247
...
@@ -19,6 +19,11 @@
...
@@ -19,6 +19,11 @@
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<groupId>
net.wanji
</groupId>
<artifactId>
signal-feign-service
</artifactId>
<version>
0.0.2
</version>
</dependency>
<dependency>
<dependency>
<groupId>
net.wanji
</groupId>
<groupId>
net.wanji
</groupId>
<artifactId>
wj-common
</artifactId>
<artifactId>
wj-common
</artifactId>
...
@@ -174,7 +179,8 @@
...
@@ -174,7 +179,8 @@
<artifactId>
mybatis-generator-maven-plugin
</artifactId>
<artifactId>
mybatis-generator-maven-plugin
</artifactId>
<version>
${mybatis.generator.version}
</version>
<version>
${mybatis.generator.version}
</version>
<configuration>
<configuration>
<configurationFile>
${basedir}/src/main/resources/mybatis-generator/generatorConfig.xml
</configurationFile>
<configurationFile>
${basedir}/src/main/resources/mybatis-generator/generatorConfig.xml
</configurationFile>
<verbose>
true
</verbose>
<verbose>
true
</verbose>
<overwrite>
true
</overwrite>
<overwrite>
true
</overwrite>
</configuration>
</configuration>
...
...
signal-optimize-service/src/main/java/net/wanji/opt/dto/CrossTurnDataRealtimeDTO.java
View file @
67f79247
...
@@ -3,7 +3,7 @@ package net.wanji.opt.dto;
...
@@ -3,7 +3,7 @@ package net.wanji.opt.dto;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.
List
;
import
java.util.
Objects
;
/**
/**
* @author hfx
* @author hfx
...
@@ -13,52 +13,78 @@ import java.util.List;
...
@@ -13,52 +13,78 @@ import java.util.List;
@Data
@Data
public
class
CrossTurnDataRealtimeDTO
{
public
class
CrossTurnDataRealtimeDTO
{
@ApiModelProperty
(
name
=
"转向ID"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"转向ID"
,
notes
=
""
)
private
String
turnId
;
private
String
turnId
;
@ApiModelProperty
(
name
=
"转向类型:u掉头;l左转;s直行;r右转;"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"转向类型:u掉头;l左转;s直行;r右转;"
,
notes
=
""
)
private
Integer
turnType
;
private
Integer
turnType
;
@ApiModelProperty
(
name
=
"驶入方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"驶入方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北"
,
notes
=
""
)
private
Integer
inDir
;
private
Integer
inDir
;
@ApiModelProperty
(
name
=
"驶出方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"驶出方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北"
,
notes
=
""
)
private
Integer
outDir
;
private
Integer
outDir
;
@ApiModelProperty
(
name
=
"路口ID"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"路口ID"
,
notes
=
""
)
private
String
crossId
;
private
String
crossId
;
@ApiModelProperty
(
name
=
"交通流量(辆)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"交通流量(辆)"
,
notes
=
""
)
private
Integer
flow
;
private
Integer
flow
;
@ApiModelProperty
(
name
=
"平均速度(km/h)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"平均速度(km/h)"
,
notes
=
""
)
private
Double
speed
;
private
Double
speed
;
@ApiModelProperty
(
name
=
"驶入速度(km/h)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"驶入速度(km/h)"
,
notes
=
""
)
private
Double
inSpeed
;
private
Double
inSpeed
;
@ApiModelProperty
(
name
=
"驶出速度(km/h)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"驶出速度(km/h)"
,
notes
=
""
)
private
Double
outSpeed
;
private
Double
outSpeed
;
@ApiModelProperty
(
name
=
"排队长度(米)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"排队长度(米)"
,
notes
=
""
)
private
Double
queueLength
;
private
Double
queueLength
;
@ApiModelProperty
(
name
=
"停车次数(次)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"停车次数(次)"
,
notes
=
""
)
private
Double
stopTimes
;
private
Double
stopTimes
;
@ApiModelProperty
(
name
=
"延误时间(秒)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"延误时间(秒)"
,
notes
=
""
)
private
Integer
delayTime
;
private
Integer
delayTime
;
@ApiModelProperty
(
name
=
"饱和度"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"饱和度"
,
notes
=
""
)
private
Double
sturation
;
private
Double
sturation
;
@ApiModelProperty
(
name
=
"车头间距(米)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"车头间距(米)"
,
notes
=
""
)
private
Double
vehheadDist
;
private
Double
vehheadDist
;
@ApiModelProperty
(
name
=
"车头时距(秒)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"车头时距(秒)"
,
notes
=
""
)
private
Double
vehheadTime
;
private
Double
vehheadTime
;
@ApiModelProperty
(
name
=
"数据批次(10位时间戳)"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"数据批次(10位时间戳)"
,
notes
=
""
)
private
Integer
batchTime
;
private
Integer
batchTime
;
private
Double
passTime
;
/**
* 计算路口各转向所需的通行时长(秒)
* 相位的通行时长需大于等于最小绿灯时长,并且小于等于最大绿灯时长
* 车头间距(米):车间据如果不在20和7之间取9(默认9)
* 车头时距(秒):车时距如果不在2和5之间取2.8(默认2.8)
* 排队车辆 = 排队长度 / 车头间距
* 通行时长 = 排队车辆 * 车头时距
*/
public
Double
calPassTime
(
CrossTurnDataRealtimeDTO
entity
)
{
Double
currentVehheadDist
=
entity
.
getVehheadDist
();
if
(
Objects
.
isNull
(
currentVehheadDist
)
||
currentVehheadDist
>
20
||
currentVehheadDist
<
7
)
{
currentVehheadDist
=
9.0
;
}
Double
currentVehheadTime
=
entity
.
getVehheadTime
();
if
(
Objects
.
isNull
(
currentVehheadTime
)
||
currentVehheadTime
>
5
||
currentVehheadTime
<
2
)
{
currentVehheadTime
=
2.8
;
}
// 排队车辆
Double
queuedVehicles
=
entity
.
getQueueLength
()
/
currentVehheadDist
;
// 通行时长
Double
calPassTime
=
queuedVehicles
*
currentVehheadTime
;
return
calPassTime
;
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/CrossOptimizeServiceImpl.java
View file @
67f79247
This diff is collapsed.
Click to expand it.
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