devsoc-unsw / devsoc-unsw/notangles

Backend: generate buildings within a path range

Open
#1,141 0 comments 0 reactions 1 assignee Claimed by @fox-58 View on GitHub
backend
Dominant language
TypeScript
Stars
79
Forks
9
PR merge metrics
No merged PRs in 30d

Description

# Feature
Develop a function that, given two building ID's, will create a line segment between the buildings.
Return a list of all buildings that are within X meters of the line segment (including the buildings themselves)

## Example Format
Parameters:
- Start Building ID
- End Building ID
- Max Offset Distance

Return:
- List of Building ID's

## Example Diagram

Image

Start Building is **Tyree Energy Technology**
End Building is **Morven Brown Building**
Max Offset is the distance in **Green**

The line segment between the buildings is in **Red**.
The box in **Blue** includes all of the buildings within the requirements.

In this case, the valid buildings would be:
- Tyree Energy Technology
- Newton Building
- Science Theatre
- Quadrangle Building
- Morven Brown Building

# Acceptance criteria
## Base Use
- Input: 2 Building ID's, varying distances
- Output: A list of building ID's within the requirements (regardless of if there are available rooms)

# Logic Revisions
**Reasoning**: We can't assume that a start and end building ID will always be provided

**Cases**:
1. Start building ID, end building ID given --> already implemented
2. Start building ID, no end building ID given --> generate a list of building IDs in the fixed radius around the start building
3. No start building ID, end building ID given --> generate a list of building IDs in the fixed radius around the end building
4. No start building ID, no end building ID given --> generate a list of building IDs in the fixed radius around the user's requested building

**Other notes:**
- Handling overlaps: in order to obtain the start or end building ID, there has to be a class that overlaps with the user's requested time. If there are two classes that overlap, both the start and end building ID can be obtained. Otherwise, treat it as if there is no start/end. room.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.