diff --git a/doc/class diagram.graphml b/doc/class diagram.graphml new file mode 100644 index 0000000..eeb99a2 --- /dev/null +++ b/doc/class diagram.graphml @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + + + + + + + Vehicle + + # position: float +# curVelocity: float +# maxVelocity: float +# brakeProb: float +# id: int +# test: int +# trackLength: float + + timeElapse(): void ++ getPosition(): float ++ getCurVelocity(): float ++ getMaxVelocity(): float ++ updateVelocity(distanceForerunner: float): void ++ timeElapse(): void + ++ Vehicle(id: id, position: int, maxVelocity: float, brakeProb: float, trackLength: float) + + + + + + + + + + + + Track + + # trackLength: float +# sumAvgMemory: float +# sumDelAvgMemory: float +# historyLength: int +# overallAvg: float +# delayedAvg: float +# lastAvg: float +# waitTime: int +# maxVelocity: float +# brakeProb: float +# steps: long +# listSemaphore: Semaphore + - Track(int, float, float, float, int, int) + ++ getVtrList(): List<List<TimeVehicleRecord>> ++ getOverallAvg(): float ++ getLastAvg(): float ++ getDelayedAvg(): float ++ getTrackLength(): float ++ getSteps(): long ++ getListSemaphore(): Semaphore ++ getHistoryLength(): int +# createVehiclesList(int): List<Vehicle> ++ setWaitTime(int): void ++ setBrakeProb(float): void ++ setMaxVelocity(float): void ++ timeElapse(): void ++ avg_step(int): float +# update_avg(): void + + + + + + + + + + + + VehicleTimeRecord + + # id: int +# position: float +# velocity: float +# maxVelocity: float + + getMaxVelocity(): float ++ getPosition(): float ++ getVelocity(): float + ++ VehicleTimeRecord(id: int, position: int, velocity: float, maxVelocity: float) + + + + + + + + + + + + TimeRecordView + + + # onSizeChanged(w: int, h: int, oldw: int, oldh: int): void + ++ TimeRecordView(context: context, track: Track) + + + + + + + + + + + + + SurfaceView + + + + + + + + + + + + + + + MainActivity + + +static defaultNoOfVehicles: int = 25 {readOnly} ++ static defaultTrackLength: int = 100 {readOnly} ++ static defaultBrakeProb: float = 0.3f {readOnly} ++ static defaultMaxVelocity: float = 5.0f {readOnly} ++ static defaultDelay: int = 0 {readOnly} ++ static defaultHistoryLength: int = 50 {readOnly} ++ static defaultFrameskip: int = 0 {readOnly} +# LinearLayout viewStack: LinearLayout + # onCreate(savedInstanceState:Bundle): void ++ static round(float number, int digits): float +# stopWorker(): void +# updateTrack(): void ++ onProgressChanged(seekBar: SeekBar, progress: int, fromUser; boolean): void ++ onStartTrackingTouch(seekBar: SeekBar): void ++ onStopTrackingTouch(seekBar: SeekBar): void ++ onStepButtonClick(view: View): void ++ onPlayButtonClick(view: View): void ++ onStopButtonClick(view: View): void ++ onClearButtonClick(view: View): void + + + + + + + + + + + + Worker + + # frameskip: int +# stop: boolean +# gui: MainActivity +# Renderer renderer +# int frameskip; + + run(): void ++ setStop(stop: boolean): void ++ setFrameskip(frames): int: void + ++ Worker(track: track, gui: MainActivity, renderer: Renderer, frameskip: int) + + + + + + + + + + + + + Thread + + + + + + + + + + + + + + + Renderer + + # pixelPerVehicle: int +# pixelPerLine: int +# float tooShortPerTrackLength: float +# float tooShortPerHeight: float +# Paint paint: Paint +# holder: SurfaceHolder +- canvas: Canvas +# width: int +# height: int + + setSize(width: int, height: int): void ++ setTrack(track: Track): void +# getColor(curVelocity: float, maxVelocity: float): int +# draw(): void + ++ Renderer(track: Track, holder: SurfaceHolder) + + + + + + + + + + + + <<interface>> +SeekBar.OnSeekBarChangeListener + + + ~ onProgressChanged(SeekBar var1, int var2, boolean var3): void +~ onStartTrackingTouch(SeekBar var1): void +~ onStopTrackingTouch(SeekBar var1): void + + + + + + + + + + + + AppCompatActivity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SurfaceHolder + + + + + + + + + diff --git a/doc/class diagram.png b/doc/class diagram.png new file mode 100644 index 0000000..1fa0b7b Binary files /dev/null and b/doc/class diagram.png differ