Commit d1214f75 authored by hanbing's avatar hanbing

[update] 新信号评价-方案评价-均衡调控和安全保障策略详细问题

parent 8cc1f43e
...@@ -96,7 +96,7 @@ public class LanePeriodicDataEventListConvert { ...@@ -96,7 +96,7 @@ public class LanePeriodicDataEventListConvert {
crossDirDataRealTimePO.setBatchTime(batchTime); crossDirDataRealTimePO.setBatchTime(batchTime);
crossDirDataRealTimePO.setGmtCreate(now); crossDirDataRealTimePO.setGmtCreate(now);
crossDirDataRealTimePO.setGmtModified(now);// crossDirDataRealTimePO.setGmtModified(now);//
crossDirDataRealTimePO.setEffusionTime(0000.0);// crossDirDataRealTimePO.seteffusionRate(0000.0);//
return crossDirDataRealTimePO; return crossDirDataRealTimePO;
} }
......
...@@ -127,15 +127,13 @@ public class EvaluateServiceImpl implements EvaluateService { ...@@ -127,15 +127,13 @@ public class EvaluateServiceImpl implements EvaluateService {
List<CrossDirDataRealtimePO> realtimeObj = dirObjMapRealtime.get(dir); List<CrossDirDataRealtimePO> realtimeObj = dirObjMapRealtime.get(dir);
if (CollectionUtil.isNotEmpty(realtimeObj)) { if (CollectionUtil.isNotEmpty(realtimeObj)) {
CrossDirDataRealtimePO crossDirDataRealtimePO = realtimeObj.get(0); CrossDirDataRealtimePO crossDirDataRealtimePO = realtimeObj.get(0);
Double effusionTime = crossDirDataRealtimePO.getEffusionTime(); Double effusionRate = crossDirDataRealtimePO.getEffusionRate();
Double effusionRate = effusionTime / minutes;
effusionRateElement.setCurrentRate(effusionRate); effusionRateElement.setCurrentRate(effusionRate);
} }
List<CrossDirDataHistAvgBO> histObj = dirObjMapHist.get(dir); List<CrossDirDataHistAvgBO> histObj = dirObjMapHist.get(dir);
if (CollectionUtil.isNotEmpty(histObj)) { if (CollectionUtil.isNotEmpty(histObj)) {
CrossDirDataHistAvgBO crossDirDataHistAvgBO = histObj.get(0); CrossDirDataHistAvgBO crossDirDataHistAvgBO = histObj.get(0);
Double avgEffusionTime = crossDirDataHistAvgBO.getAvgEffusionTime(); Double avgEffusionRate = crossDirDataHistAvgBO.getAvgEffusionRate();
Double avgEffusionRate = avgEffusionTime / minutes;
effusionRateElement.setCompareRate(avgEffusionRate); effusionRateElement.setCompareRate(avgEffusionRate);
} }
res.add(effusionRateElement); res.add(effusionRateElement);
......
...@@ -38,11 +38,11 @@ public class StrategyAndMetricsEnum { ...@@ -38,11 +38,11 @@ public class StrategyAndMetricsEnum {
MAX_QUEUE_LENGTH("4", "最大排队长度", "m"), MAX_QUEUE_LENGTH("4", "最大排队长度", "m"),
STOP_TIMES("5", "停车次数", "次"), STOP_TIMES("5", "停车次数", "次"),
AVERAGE_SPEED("6", "平均速度", "km/h"), AVERAGE_SPEED("6", "平均速度", "km/h"),
GREEN_LIGHT_UTILIZATION("7", "绿灯有效利用率", "%"), GREEN_LIGHT_EFFICIENCY("7", "绿灯有效利用率", "%"),
SATURATION("8", "饱和度", ""), SATURATION("8", "饱和度", ""),
LOAD_BALANCE("9", "负载均衡度", ""), LOAD_BALANCE("9", "负载均衡度", ""),
EFFUSION_RATE("10", "溢流率", "%"), EFFUSION_RATE("10", "溢流率", "%"),
GREEN_INTERVAL_CLEAR("11", "绿灯间隔清空率", "%"), CLEAR_RATE("11", "绿灯间隔清空率", "%"),
EMERGENCY_COUNT("12", "三急一速数量", ""); EMERGENCY_COUNT("12", "三急一速数量", "");
private final String code; private final String code;
...@@ -71,13 +71,13 @@ public class StrategyAndMetricsEnum { ...@@ -71,13 +71,13 @@ public class StrategyAndMetricsEnum {
Metrics.AVERAGE_SPEED Metrics.AVERAGE_SPEED
)); ));
map.put(Strategy.BALANCE, Arrays.asList( map.put(Strategy.BALANCE, Arrays.asList(
Metrics.GREEN_LIGHT_UTILIZATION, Metrics.GREEN_LIGHT_EFFICIENCY,
Metrics.SATURATION, Metrics.SATURATION,
Metrics.LOAD_BALANCE Metrics.LOAD_BALANCE
)); ));
map.put(Strategy.SECURITY, Arrays.asList( map.put(Strategy.SECURITY, Arrays.asList(
Metrics.EFFUSION_RATE, Metrics.EFFUSION_RATE,
Metrics.GREEN_INTERVAL_CLEAR, Metrics.CLEAR_RATE,
Metrics.EMERGENCY_COUNT Metrics.EMERGENCY_COUNT
)); ));
STRATEGY_METRICS_MAP = Collections.unmodifiableMap(map); STRATEGY_METRICS_MAP = Collections.unmodifiableMap(map);
......
...@@ -14,6 +14,6 @@ public class CrossDirDataHistAvgBO { ...@@ -14,6 +14,6 @@ public class CrossDirDataHistAvgBO {
private Double avgQueueLength; private Double avgQueueLength;
// 平均拥堵指数 // 平均拥堵指数
private Double avgIndex; private Double avgIndex;
// 平均溢流时长 // 平均溢流
private Double avgEffusionTime; private Double avgEffusionRate;
} }
...@@ -20,4 +20,8 @@ public interface BaseCrossDirInfoMapper { ...@@ -20,4 +20,8 @@ public interface BaseCrossDirInfoMapper {
List<BaseCrossDirInfoPO> selectByCrossId(String crossId); List<BaseCrossDirInfoPO> selectByCrossId(String crossId);
List<BaseCrossDirInfoPO> selectByCrossIdAndInOutType(String crossId, Integer type); List<BaseCrossDirInfoPO> selectByCrossIdAndInOutType(String crossId, Integer type);
List<String> selectLaneIds(String crossId, Integer dirCode);
Integer selectDirEmergencyCount(String crossId, List<String> laneIds, int startTimeStamp, int endTimeStamp);
} }
...@@ -26,4 +26,6 @@ public interface CrossDataHistMapper extends BaseMapper<CrossDataHistPO> { ...@@ -26,4 +26,6 @@ public interface CrossDataHistMapper extends BaseMapper<CrossDataHistPO> {
List<MetricHistDTO> selectMetricHistDTO(String crossId, int startStamp, int endStamp); List<MetricHistDTO> selectMetricHistDTO(String crossId, int startStamp, int endStamp);
Double selectMaxSaturation(String crossId, int startStamp, int endStamp); Double selectMaxSaturation(String crossId, int startStamp, int endStamp);
Integer selectCrossEmergencyCount(String crossId, int startTimeStamp, int endTimeStamp);
} }
...@@ -42,4 +42,6 @@ public interface CrossDirDataHistMapper extends BaseMapper<CrossDirDataHistPO> { ...@@ -42,4 +42,6 @@ public interface CrossDirDataHistMapper extends BaseMapper<CrossDirDataHistPO> {
Double selectMaxQueueLength(String crossId, Integer dirType, Integer inOutType, int startStamp, int endStamp); Double selectMaxQueueLength(String crossId, Integer dirType, Integer inOutType, int startStamp, int endStamp);
Double selectMaxSaturation(String crossId, Integer dirType, Integer inOutType, int startStamp, int endStamp); Double selectMaxSaturation(String crossId, Integer dirType, Integer inOutType, int startStamp, int endStamp);
Double selectMaxGreenLightEfficiency(String crossId, Integer dirCode, Integer code, int startTimeStamp, int endTimeStamp);
} }
...@@ -63,6 +63,13 @@ public class CrossDirDataRealtimePO { ...@@ -63,6 +63,13 @@ public class CrossDirDataRealtimePO {
private Date gmtCreate ; private Date gmtCreate ;
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(name = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
@ApiModelProperty(name = "溢流时长,计算溢流率提供;溢流率:交叉口间路段车辆排队长度超出可容纳空间的时长与观测总时长的百分比",notes = "") @ApiModelProperty(name = "溢流率:交叉口间路段车辆排队长度超出可容纳空间的时长与观测总时长的百分比",notes = "")
private Double effusionTime; private Double effusionRate;
@ApiModelProperty(value = "绿灯间隔清空率", notes = "")
private Double clearRate;
@ApiModelProperty(value = "负载均衡度", notes = "")
private Double loadBalance;
@ApiModelProperty(value = "绿灯有效利用率", notes = "")
private Double greenLightEfficiency;
} }
...@@ -88,4 +88,13 @@ public class CrossTurnDataRealtimePO { ...@@ -88,4 +88,13 @@ public class CrossTurnDataRealtimePO {
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(name = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
@ApiModelProperty(value = "绿灯间隔清空率", notes = "")
private Double clearRate;
@ApiModelProperty(value = "负载均衡度", notes = "")
private Double loadBalance;
@ApiModelProperty(value = "绿灯有效利用率", notes = "")
private Double greenLightEfficiency;
@ApiModelProperty(name = "溢流率:交叉口间路段车辆排队长度超出可容纳空间的时长与观测总时长的百分比",notes = "")
private Double effusionRate;
} }
...@@ -32,4 +32,23 @@ ...@@ -32,4 +32,23 @@
where cross_id = #{crossId} and in_out_type = #{type} where cross_id = #{crossId} and in_out_type = #{type}
</select> </select>
<select id="selectLaneIds" resultType="java.lang.String">
select id
from t_base_lane_info
where cross_id = #{crossId} and dir = #{dirCode}
</select>
<select id="selectDirEmergencyCount" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM holo_roadnet_jinan.t_event_info
WHERE type IN ('33', '34', '35', '6')
AND UNIX_TIMESTAMP(start_time) <![CDATA[ >= ]]> #{startStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ <= ]]> #{endStamp}
AND cross_id = #{crossId}
AND lane_id in
<foreach collection="laneIds" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
</mapper> </mapper>
...@@ -95,4 +95,13 @@ ...@@ -95,4 +95,13 @@
and batch_time <![CDATA[ <= ]]> #{endStamp} and batch_time <![CDATA[ <= ]]> #{endStamp}
</select> </select>
<select id="selectCrossEmergencyCount" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM holo_roadnet_jinan.t_event_info
WHERE type IN ('33', '34', '35', '6')
AND UNIX_TIMESTAMP(start_time) <![CDATA[ >= ]]> #{startStamp}
AND UNIX_TIMESTAMP(start_time) <![CDATA[ <= ]]> #{endStamp}
AND cross_id = #{crossId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -22,12 +22,17 @@ ...@@ -22,12 +22,17 @@
<result column="batch_time" property="batchTime"></result> <result column="batch_time" property="batchTime"></result>
<result column="gmt_create" property="gmtCreate"></result> <result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result> <result column="gmt_modified" property="gmtModified"></result>
<result column="effusion_time" property="effusionTime"></result> <result column="effusion_rate" property="effusionRate"></result>
<result column="clear_rate" property="clearRate"></result>
<result column="load_balance" property="loadBalance"></result>
<result column="green_light_efficiency" property="greenLightEfficiency"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,dir_type,in_out_type,cross_id,length,status,traffic_index,start_time,capacity,duration,flow,speed,queue_length,stop_times, id,dir_type,in_out_type,cross_id,length,status,traffic_index,start_time,capacity,duration,flow,speed,queue_length,stop_times,
delay_time,sturation,no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,batch_time,gmt_create,gmt_modified,effusion_time delay_time,sturation,no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,batch_time,gmt_create,gmt_modified,effusion_rate,
load_balance,clear_rate,green_light_efficiency
</sql> </sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDirDataHistPO"> <insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDirDataHistPO">
...@@ -39,7 +44,7 @@ ...@@ -39,7 +44,7 @@
#{entity.trafficIndex}, #{entity.startTime}, #{entity.capacity}, #{entity.duration}, #{entity.flow}, #{entity.trafficIndex}, #{entity.startTime}, #{entity.capacity}, #{entity.duration}, #{entity.flow},
#{entity.speed}, #{entity.queueLength}, #{entity.stopTimes}, #{entity.delayTime}, #{entity.sturation}, #{entity.speed}, #{entity.queueLength}, #{entity.stopTimes}, #{entity.delayTime}, #{entity.sturation},
#{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},#{entity.batchTime}, #{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},#{entity.batchTime},
#{entity.gmtCreate}, #{entity.gmtModified}, #{entity.effusionTime} ) #{entity.gmtCreate}, #{entity.gmtModified}, #{entity.effusionRate} )
</foreach> </foreach>
</insert> </insert>
...@@ -70,7 +75,7 @@ ...@@ -70,7 +75,7 @@
<select id="selectByCrossIdInOutTimestamp" resultType="net.wanji.databus.bo.CrossDirDataHistAvgBO"> <select id="selectByCrossIdInOutTimestamp" resultType="net.wanji.databus.bo.CrossDirDataHistAvgBO">
SELECT dir_type as dirType, avg(capacity) as avgCapacity, avg(flow) as avgFlow, SELECT dir_type as dirType, avg(capacity) as avgCapacity, avg(flow) as avgFlow,
avg(queue_length) as avgQueueLength, avg(traffic_index) as avgIndex, avg(queue_length) as avgQueueLength, avg(traffic_index) as avgIndex,
avg(effusion_time) as avgEffusionTime avg(effusion_rate) as avgeffusionRate
FROM t_cross_dir_data_hist FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId} WHERE cross_id = #{crossId}
AND in_out_type = #{inOutType} AND in_out_type = #{inOutType}
...@@ -127,7 +132,7 @@ ...@@ -127,7 +132,7 @@
and batch_time <![CDATA[ <= ]]> #{endStamp} and batch_time <![CDATA[ <= ]]> #{endStamp}
</select> </select>
<select id="selectMaxDelayTime" resultType="java.lang.Double"> <select id="selectMaxDelayTime" resultType="java.lang.Integer">
select max(delay_time) select max(delay_time)
from t_cross_dir_data_hist from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType} where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
...@@ -151,4 +156,12 @@ ...@@ -151,4 +156,12 @@
and batch_time <![CDATA[ <= ]]> #{endStamp} and batch_time <![CDATA[ <= ]]> #{endStamp}
</select> </select>
<select id="selectMaxGreenLightEfficiency" resultType="java.lang.Double">
select max(green_light_efficiency)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -26,12 +26,17 @@ ...@@ -26,12 +26,17 @@
<result column="batch_time" property="batchTime"></result> <result column="batch_time" property="batchTime"></result>
<result column="gmt_create" property="gmtCreate"></result> <result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result> <result column="gmt_modified" property="gmtModified"></result>
<result column="effusion_time" property="effusionTime"></result> <result column="effusion_rate" property="effusionRate"></result>
<result column="clear_rate" property="clearRate"></result>
<result column="load_balance" property="loadBalance"></result>
<result column="green_light_efficiency" property="greenLightEfficiency"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,dir_type,in_out_type,cross_id,length,status,traffic_index,start_time,capacity,duration, flow,speed,queue_length,stop_times, id,dir_type,in_out_type,cross_id,length,status,traffic_index,start_time,capacity,duration, flow,speed,queue_length,stop_times,
delay_time,sturation,no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,batch_time,gmt_create,gmt_modified,effusion_time delay_time,sturation,no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,batch_time,gmt_create,gmt_modified,effusion_rate,
load_balance,clear_rate,green_light_efficiency
</sql> </sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDirDataRealtimePO"> <insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDirDataRealtimePO">
...@@ -42,7 +47,7 @@ ...@@ -42,7 +47,7 @@
( #{entity.id}, #{entity.dirType}, #{entity.inOutType}, #{entity.crossId}, #{entity.length}, #{entity.status}, #{entity.trafficIndex}, #{entity.startTime}, #{entity.capacity}, #{entity.duration}, #{entity.flow}, ( #{entity.id}, #{entity.dirType}, #{entity.inOutType}, #{entity.crossId}, #{entity.length}, #{entity.status}, #{entity.trafficIndex}, #{entity.startTime}, #{entity.capacity}, #{entity.duration}, #{entity.flow},
#{entity.speed}, #{entity.queueLength}, #{entity.stopTimes}, #{entity.delayTime}, #{entity.sturation}, #{entity.speed}, #{entity.queueLength}, #{entity.stopTimes}, #{entity.delayTime}, #{entity.sturation},
#{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},#{entity.batchTime}, #{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},#{entity.batchTime},
#{entity.gmtCreate}, #{entity.gmtModified}, #{entity.effusionTime} ) #{entity.gmtCreate}, #{entity.gmtModified}, #{entity.effusionRate} )
</foreach> </foreach>
</insert> </insert>
......
...@@ -29,12 +29,18 @@ ...@@ -29,12 +29,18 @@
<result column="gmt_create" property="gmtCreate"></result> <result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result> <result column="gmt_modified" property="gmtModified"></result>
<result column="start_time" property="startTime"></result> <result column="start_time" property="startTime"></result>
<result column="clear_rate" property="clearRate"></result>
<result column="load_balance" property="loadBalance"></result>
<result column="green_light_efficiency" property="greenLightEfficiency"></result>
<result column="effusion_rate" property="effusionRate"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, turn_type, in_dir, out_dir, cross_id, flow, status, traffic_index, speed, in_speed, out_speed, queue_length, id, turn_type, in_dir, out_dir, cross_id, flow, status, traffic_index, speed, in_speed, out_speed, queue_length,
stop_times, delay_time, sturation, vehhead_dist, vehhead_time, quality, batch_time, gmt_create, gmt_modified, stop_times, delay_time, sturation, vehhead_dist, vehhead_time, quality, batch_time, gmt_create, gmt_modified,
no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,start_time no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,start_time,
load_balance,clear_rate,green_light_efficiency,effusion_rate
</sql> </sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossTurnDataRealtimePO"> <insert id="insertBatch" parameterType="net.wanji.databus.po.CrossTurnDataRealtimePO">
......
...@@ -29,12 +29,19 @@ ...@@ -29,12 +29,19 @@
<result column="gmt_create" property="gmtCreate"></result> <result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result> <result column="gmt_modified" property="gmtModified"></result>
<result column="start_time" property="startTime"></result> <result column="start_time" property="startTime"></result>
<result column="clear_rate" property="clearRate"></result>
<result column="load_balance" property="loadBalance"></result>
<result column="green_light_efficiency" property="greenLightEfficiency"></result>
<result column="effusion_rate" property="effusionRate"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, turn_type, in_dir, out_dir, cross_id, flow, status, traffic_index, speed, in_speed, out_speed, queue_length, id, turn_type, in_dir, out_dir, cross_id, flow, status, traffic_index, speed, in_speed, out_speed, queue_length,
stop_times, delay_time, sturation, vehhead_dist, vehhead_time, quality, batch_time, gmt_create, gmt_modified, stop_times, delay_time, sturation, vehhead_dist, vehhead_time, quality, batch_time, gmt_create, gmt_modified,
no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,start_time no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,start_time,
load_balance,clear_rate,green_light_efficiency,effusion_rate
</sql> </sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossTurnDataRealtimePO"> <insert id="insertBatch" parameterType="net.wanji.databus.po.CrossTurnDataRealtimePO">
......
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