Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #97 from ur-cs-courses/update-design-documentation
Browse files Browse the repository at this point in the history
Updated design documentation
  • Loading branch information
lizlouise1335 authored Dec 13, 2023
2 parents ad45091 + a4d3f2e commit 0977821
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 65 deletions.
94 changes: 62 additions & 32 deletions docs/design/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
## Introduction
In our design document, we will be going over how we plan on developing our robot fleet management system.

_* Our actual design implementation isn't fully completed yet. We are still in the beginning phases of our Scrum development process._

## Project Overview

**Our software will help building managers, the customers, manage their fleet of cleaning robots in their building.**
Expand All @@ -28,26 +26,32 @@ This document describes the class diagram for a simple management system that in

Attributes

* room_clean: set: A set containing the rooms that are clean.
* rooms_dirty: set: A set containing the rooms that are dirty.
* bots_ready: set: A set containing the robots that are ready for cleaning.
* bots_out: set: A set containing the robots that are currently out cleaning or out of commission.
* `room_list_`: *set* - A map containing the rooms added to the system
* `robot_list_`: *set* - A map containing the robots added to the system
* `assignment_map`: *set* - A map containing the assignment of robots to rooms
* `csv_path_room_`: *string* - A string representing the path to the csv file containing the rooms of a building
* `csv_path_robot_`: *string* - A string representing the path to the csv file containing the set of rooms a manager has in their fleet

Methods

* assign_bots(): void: Assigns robots to rooms for cleaning.
* update_rooms(): void: Updates the status of rooms (clean/dirty).
* update_bots(): void: Updates the status of robots (clean/dirty).
* availability_string(): string: Returns a string representing the availability of robots (available/not).
* room_status_string(): string: Returns a string representing the status of rooms (clean/dirty).
* bot_data_string(): string: Returns a string representing the status of robots (size, type).
* add_new_bot(): void: Adds a new robot to the system.
* add_new_room(): void: Adds a new room to the system.
* `initialize_room_list_from_csv_file(string)`: *void* - Reads csv file for rooms to be added to the system.
* `initialize_robot_list_from_csv_file(string)`: *void* - Reads csv file for robots to be added to the system
* `add_new_bot(string)`: *void* - Adds a new robot to the system based on passed strings [requires 5 string parameters].
* `add_new_room(string)`: *void* - Adds a new room to the system based on passed string [requires 4 string parameters].
* `maintenance(string)`: *void* - Takes a user-chosen robot offline for repairs
* `cleaning(Robot, Room, int)`: *void* - Simulates a robot cleaning a room for a calculated amount of time, including possibility of breaking or running out of battery.
* `cleaning_assignment(string)`: *void* - Assigns a user-chosen robot to a user-chosen room for cleaning
* `charge(string)`: *void* - Takes a user-chosen robot offline for charging
* `to_string_room_list()`: *string* - Returns the overall room details of room_list_
* `to_string_robot_list()`: *string* - Returns the overall robot details of robot_list_
* `get_bot(string)`: *Robot* - Returns the corresponding Robot of the string id passed
* `get_room(string)`: *Room* - Returns the corresponding Room of the string id passed


Relationships

* The Management class has a 1 to 0...n aggregation relationship with the Rooms class.
* The Management class has a 1 to 0...n composition relationship with the Robots class.
* The Management class has a 1 to 0...n aggregation relationship with the Robots class.
* The Management class implements the CommandLine interface.

## Robot Class Diagram Overview
Expand All @@ -61,42 +65,68 @@ This document describes the class diagram for a system of robots that involves r

Attributes

* room_assigned: string: A string to represent room assigned for robot to clean.
* task_assigned: string: A string to represent task of either mop, scrub, or vacuum.
* robot_status: string: A string to represent the status of robot ready or not.
* timer: int: An integer to represent time needed to clean the assigned room.
* `id_`: *string* - A string representing the id of a robot
* `room_id_`: *string* - A string representing the room a robot is assigned to clean.
* `size_`: *enum* - An enum representing the size of a robot
* `status_`: *enum* - An enum representing the current status of a robot, including: **Free, Busy, Offline, Broken, Dead**.
* `type_`: *enum* - An enum representing the type of a robot is either: **mop, scrub, vaccuum**.
* `battery_`: *int* - An integer representing the current battery of a robot.

Methods

* clean_room(): void: Robot set to clean assigned room.
* go_home(): void: Robot sent back home.
* get_robot_status(): Returns a string representing whether robot has failed or not.
* update_robot_status(): Sets robot status to a string representing whether robot is ready for new task or not.
* `go_home()`: *void* - Resets the status and room assignment
* `kill_battery()`: *void* - Decrements the current battery power of a robot based on its type. Larger robots last longer than others.
* `charge_battery()`: *void* - Restores the battery to full power
* `set_status(string)`: *void* - Updates the status of a robot based on string input given
* `set_size(string)`: *void* - Sets the size of a robot based on string input given
* `set_type(string)`: *void* - Sets the type of a robot based on string input given
* `set_room(string)`: *void* - Updates the room assignment of a robot either when manager assigns or when a robot is finished
* `get_id()`: *string* - Returns the id of the robot
* `get_room()`: *string* - Returns the current room assignment
* `get_size()`: *enum* - Returns an enum of the robot size
* `get_status()`: *enum* - Returns an enum of the current status
* `get_battery()`: *int* - Returns an int representing the current battery "percentage" of a robot
* `to_string_status()`: *string* - Returns a string representing the robot status. Used only as a helper function for the `to_string()` function.
* `to_string_size()`: *string* - Returns a string representing the robot size. Used only as a helper function for the `to_string()` function.
* `to_string_type()`: *string* - Returns a string representing the robot type. Used only as a helper function for the `to_string()` function.
* `to_string()`: *string* - Returns a string containing the details of a robot object instance.

Relationships

* The Robot class has a 1 to 1 aggregation relationship with the Rooms class.
* The Robot class has a 1-to-1 composition with enum class Size.
* The Robot class has a 1-to-1 composition with enum class Status.
* The Robot class has a 1-to-1 composition with enum class Type.

## Room Class Diagram Overview

![Diagram Description](images/room_class_diagram.png)

This document describes the class diagram for a system of rooms that involves receiving input commands and cleaning rooms. The system focuses on the attributes of the Room class and mentions its relationships with other classes and interfaces (Management, Robots, and enum classes Status and Size).
This document describes the class diagram for a system of rooms that involves maintaining the cleanliness. The system focuses on the attributes of the Room class and mentions its relationships with other classes and interfaces (Management, Robots, and enum classes Status and Size).

## Classes
### Room

Attributes

* room_name: string: The name of a room
* status: enum: The status of the room currently assigned.
* size: enum: The size of the room
* `room_name_`: *string* - A string representing the name/id of a room
* `room_status_`: *enum* - An enum representing the status of a room as either: **Dirty, In-progress, Clean**
* `room_size_`: *enum* - An enum representing the size of a room
* `estimated_time_`: *int* - An int representing the approximate time to clean a room

Methods

* update_room_status(): void: Updates whether the current room is cleaned.
* get_room_status(): Returns an enum representing the current state of the assigned room (dirty, in-progress, clean).
* get_size(): Returns an enum representing the size of a room (small, medium, large).
* `convert_to_status(string)`: *void* - Converts string input to an enum representing the appropriate room status. Used only during room instance creation.
* `convert_to_size(string)`: *void* - Converts string input to an enum representing the appropriate room size. Used only during room instance creation.
* `to_lower(string)`: *void* - Converts passed string input to lowercase to cover most variations of strings. Used only during room instance creation.
* `set_status(enum)`: *void* - Updates the status of a room.
* `get_status()`: *enum* - Returns an enum indicating the current state of the room (dirty, in-progress, clean).
* `set_time_to_clean(int)`: *void* - Updates the time to clean the room according to the current cleaning progress made.
* `get_time_to_clean()`: *int* - Returns an int representing the current time duration it may take for the room to be cleaned.
* `get_id()`: *string* - Returns a string representing the room identifier/name.
* `to_string_status()`: *string* - Returns a string representing the room status. Used only as a helper function for the `to_string()` function.
* `to_string_size()`: *string* - Returns a string representing the room size. Used only as a helper function for the `to_string()` function.
* `to_string_time()`: *string* - Returns a string representing the approximate time to clean a room. Used only as a helper function for the `to_string()` function.
* `to_string()`: *string* - Returns a string containing the details of a room object instance.

Relationships

Expand Down Expand Up @@ -204,4 +234,4 @@ This documentation explains an activity diagram that outlines the overall activi
- Check Robot Status
- Check Room Status

![Diagram Description](images/activity_diagram.png)
![Diagram Description](images/activity_diagram.png)
28 changes: 14 additions & 14 deletions docs/design/class_diagrams/management_class_diagram.puml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@startuml
class Management {
- room_clean: set
- rooms_dirty: set
- bots_ready: set
- bots_out: set
+ assign_bots(): void
+ update_rooms(): void
+ update_bots(): void
+ availability_string(): string
+ room_status_string(): string
+ bot_data_string(): string
+ add_new_bot(): void
+ add_new_room(): void
- set room_list_
- set robot_list_
- set assignment_map
- String csv_path_room_
- String csv_path_robot_
- initialize_room_list_from_csv_file(string): void
- initialize_robot_list_from_csv_file(string): void
+ add_new_robot(string): void
+ add_new_room(string): void
+ maintenance(string): void
+ cleaning(Robot, Room, int): void
+ cleaning_assignment(string): void
+ charge(string): void
}

interface CommandLine {}
Expand All @@ -22,7 +22,7 @@ class Robots{}
class Rooms{}

Management "1" o--> "0...n" Rooms
Management "1" *--> "0...n" Robots
Management "1" o--> "0...n" Robots
Management ..|> CommandLine
@enduml

45 changes: 34 additions & 11 deletions docs/design/class_diagrams/robot_class_diagram.puml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
@startuml
class Robot {
- room_assigned: string
- task_assigned: string
- robot_status: string
- timer: int
+ clean_room(): void
- String id_
- String room_id_
- enum size_
- enum status_
- enum type_
- int battery_
+ go_home(): void
+ get_robot_status(): string
+ update_robot_status(): string
+ kill_battery(): void
+ charge_battery(): void
}

enum Type {
Mop
Scrub
Vaccuum
}

enum Status {
Free
Busy
Broken
Dead
Offline
}

enum Size {
Small
Medium
Large
}

interface CommandLine {}

Management "1" o--> "0...n" Rooms
Management "1" *--> "0...n" Robot
Robot "1" o--> "1" Rooms
Management "1" o--> "0...n" Room
Management "1" o--> "0...n" Robot
Robot "1" *--> "1" Type
Robot "1" *--> "1" Status
Room "1" *--> "1" Size
Robot "1" *--> "1" Size
Management ..|> CommandLine
@enduml
19 changes: 11 additions & 8 deletions docs/design/class_diagrams/room_class_diagram.puml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
@startuml
class Room {
+ String room_name
- enum status
- enum size
+ update_room_status(): void
+ get_room_status(): enum status
+ get_size(): enum size
- String room_name_
- enum room_status_
- enum room_size_
- int estimated_time_
+ set_status(enum): void
+ set_time_to_clean(int): void
+ get_time_to_clean(): int
+ get_id(): string
+ get_status(): enum
}

enum Status {
Expand All @@ -23,9 +26,9 @@ enum Size {
interface CommandLine {}

Management "1" o--> "0...n" Room
Management "1" *--> "0...n" Robot
Robot "1" o--> "1" Room
Management "1" o--> "0...n" Robot
Room "1" *--> "1" Status
Room "1" *--> "1" Size
Robot "1" *--> "1" Size
Management ..|> CommandLine
@enduml
Binary file modified docs/design/images/management_class_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/design/images/robot_class_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/design/images/room_class_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0977821

Please sign in to comment.