傻瓜电梯类图
2020-12-21 10:13:11 0 举报
傻瓜电梯类图
作者其他创作
大纲/内容
1:1
Request(请求类)
type:Stringdst:intdirection:StringrequestTime:doubleWarningDate:datestartTime:doubleendTime:doublesrc:int
n:1
Floor(楼层类)
floor:int
Floor(int floor)
Elevator(电梯类)
floors:intresidenceTime:doublemoveOneFloorTime:doublecurFloor:int
RequestQueue(请求队列类)
requests:Deque<Request>
RequestQueue()offer(Request r)clear()getLast() size()poll()
1:n
Error(用于打印错误信息)
error(String msg)main(String[] args)
Scheduler(调度器类)
frequests:RequestQueueelevator:Elevatorfloors:Floor[]responses:List<String>requestQueues:ArrayList<ArrayList<Request>>
Scheduler()schedule()isValidCommand(String cmd) generateRequest(String cmd)isValidRequest(Request r)calculateStartTime(Request r)calculateEndTime(Request r)output(Request r)main(String[] args)
0 条评论
下一页