Ray
Ray是加州伯克利分校的RISE实验室退出的一个分布式执行平台。
Ray RLib是一个可扩展的强化学习库,可在多个机器上运行与openAI gym完全兼容,支持Tensorflow和PyTorch。
Ray.tune是一个高效的分布式超参数搜索库,提供了API以执行深度学习、强化学习和其它计算密集型任务。
安装过程出现问题:
Make a simulation step and simulate up to the given second in sim time.
If the given value is 0 or absent, exactly one step is performed.
Values smaller than or equal to the current sim time result in no action.
simulation重点函数
getCurrentTime(self)
getCurrentTime() -> integer
Returns the current simulation time in ms.
- getLoadedNumber(self)
getLoadedNumber() -> integer
Returns the number of vehicles which were loaded in this time step.
Returns the total number of vehicles for the last time step on the given lane.
- getLastStepHaltingNumber(self, laneID)
getLastStepHaltingNumber(string) -> integer
Returns the total number of halting vehicles for the last time step on the given lane.
A speed of less than 0.1 m/s is considered a halt.
#### vehicle重点函数
- getWaitingTime(self, vehID)
getWaitingTime() -> double
计算车辆等待时间(若车辆有意停在服务区/停车区,则不作等待时间算)
The waiting time of a vehicle is defined as the time (in seconds) spent with a
speed below 0.1m/s since the last time it was faster than 0.1m/s.
(basically, the waiting time of a vehicle is reset to 0 every time it moves).
A vehicle that is stopping intentionally with a does not accumulate waiting time.
- getAccumulatedWaitingTime(self, vehID)
getAccumulatedWaitingTime() -> double
计算一定时间间隔内某车的累计等待时间,时间间隔的以waiting-time-memory设置
The accumulated waiting time of a vehicle collects the vehicle’s waiting time over a
certain time interval (interval length is set per option ‘–waiting-time-memory’)
#### trafficlight重点函数
- getIDList(self)
getIDList() -> list(string)
Returns a list of all objects in the network.
- getPhase(self,tlsID)
getPhase(string) -> integer
注意!此函数返回的是相位索引!
Returns the index of the current phase within the list of all phases of the
current program.
- getPhaseDuration(self, tlsID)
getPhaseDuration(string) -> double
返回当前相位的总共持续时间
Returns the total duration of the current phase (in seconds). This value is not
affected by the elapsed or remaining duration of the current phase.
- setPhase(self,tlsID,index)
setPhase(string, integer) -> None
Switches to the phase with the given index in the list of all phases
for the current program.
- setPhaseDuration(self,tlsID,phaseDuration)
setPhaseDuration(string, double) -> None
设置当前相位的剩余持续时间(秒),对之后周期的此相位的无影响!
Set the remaining phase duration of the current phase in seconds.
This value has no effect on subsquent repetitions of this phase.
- getControlledLanes(self, tlsID)
getControlledLanes(string) -> c
Returns the list of lanes which are controlled by the named traffic light.