|
|
@@ -222,9 +222,8 @@ function _fluctuate(base, range) {
|
|
|
|
|
|
/** 动态更新路口状态(每次调用随机波动少量路口) */
|
|
|
function _dynamicPoints() {
|
|
|
- const now = Math.floor(Date.now() / 5000) // 每5秒切换一批
|
|
|
return DB.points.map((p, i) => {
|
|
|
- const r = seededRand(now + i)
|
|
|
+ const r = seededRand(i + 31)
|
|
|
const status = r < 0.78 ? 'normal' : r < 0.92 ? 'busy' : 'alarm'
|
|
|
return { ...p, status, updatedAt: Date.now() - Math.floor(r * 120000) }
|
|
|
})
|
|
|
@@ -585,7 +584,7 @@ export async function apiGetCrossingList(params = {}) {
|
|
|
const phaseData = _makePhaseData(cycleLength, false)
|
|
|
return {
|
|
|
...r,
|
|
|
- status: statuses[Math.floor(seededRand(Math.floor(Date.now() / 10000) + i) * statuses.length)],
|
|
|
+ status: statuses[Math.floor(seededRand(i + 42) * statuses.length)],
|
|
|
cycle: cycleLength,
|
|
|
phaseData,
|
|
|
currentTime: Math.floor(seededRand(i + 7) * cycleLength),
|