COMP2511 Back in Blackout
Posted 915e3eft
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了COMP2511 Back in Blackout相关的知识,希望对你有一定的参考价值。
Back in Blackout
Forked from an inaccessible project
Update README.md
Braedon Wooding authored 3 days ago
9d407a6e
Name Last commit Last update
Ready to go back in blackout 2 weeks ago
Update README.md 3 days ago
Due: 8am Tuesday Week 4 (22nd June 2021)
Value: 15% of course mark
COMP2511 Assignment: Back in Blackout
Contents
- Change Log
Your Private Repository
Video - Aims
- Preamble and Problem
A simple example
Simulation - Requirements
Assumptions
Devices
Satellites and Properties
Visualisation - Program Structure
- Tasks
Task 1 (World State)
Task 1 a) Create Device
Task 1 b) Move Device
Task 1 b) Remove Device
Task 1 d) Create Satellite
Task 1 e) Remove Satellite
Task 1 f) Show World State
Task 1 Example
Task 2 (Simulation)
Task 2 a) Schedule Device Activation
Task 2 b) Run the Simulation
Task 2 Example
Task 3 (Specialised Devices)
List of Libraries you can use - Other Requirements
- Design
- Testing and Dryruns
Assignment-Specification
Project ID: 143612 Leave project - 0
? README.md
COMP2511 Assignment: Back in Blackout
Contents
imgs
README.md
2021/6/19 COMP2511 / 21T2 / Assignment-Specification · GitLab
https://gitlab.cse.unsw.edu.a... 2/17 - Style and Documentation
- Tips
- Submission
- Late Penalties
- Marking Criteria ?
- Credits
Fri 4 Jun: Clarified List of Libraries that are allowed.
Sat 5 Jun:
Removed decimal place requirement on positions (just put the doubles as they are)
Fixed up a typo in one of the examples
(Merged into your repositories): TestHelper now doesn\'t require an exception message to exist (since some exceptions don\'t include it)
Fixed Test Paths in Spec
Fixed up velocity for one of the examples
Tue 8 Jun:
Clarified activation periods
Simplified order of device connection
Wed 9 Jun:
Submission is now available!
Specified that devices should connect based on lexiographical order
Thurs 10 Jun:
Make Part 3 a little more specific.
Sun 13 Jun:
Give a bit more of a hint to the pseudo code for Task2
Is located at https://gitlab.cse.unsw.edu.a...
Make sure to replace the zID in the header.
Video discussing the assignment / test code
Practice applying a systematic approach to object-oriented design process
Gain experience in implementing an object-oriented program with multiple interacting classes
Gain hands on experience with Java libraries and JSON
So much of today\'s technology uses Global Positioning System (GPS) information, for example, tasks such as tagging photographs with the
location where they were taken, guiding drivers with car navigation systems, and even missile control systems. There are currently 31 active GPS
satellites orbiting the Earth all together providing near-constant GPS coverage. There are many other types of satellites too, such as the new
SpaceX satellites aiming to provide internet access.
In the far future, society has advanced enough that we have started to occupy the rings of Jupiter. However, to remain connected with the rest
of the universe they still rely on satellites! Four major corporations exist: SpaceX, Blue Origin, NASA (National Aeronautics and Space
Administration), and Soviet Satellites.
Firstly, you will set up a very simplified simulation of the ring and its rotating satellites. Then we’ll be running the simulation (causing the
satellites to orbit) and you’ll be responsible for maintaining connections.
You will need to develop, design, and implement an object-oriented approach that utilises concepts such as abstraction, encapsulation,
composition, and inheritance as taught in lectures.
Let’s assume initially there is a Blue Origin Satellite at height 10,000m above the centre of Jupiter and at θ = 20 (anticlockwise), there are three
devices in a (hollow) ring: DeviceA at θ = 30 (anticlockwise), DeviceB at θ = 180 (anticlockwise) and DeviceC at θ = 330 (anticlockwise). - Change Log
Your Private Repository
Video - Aims
- Preamble and Problem
A simple example
2021/6/19 COMP2511 / 21T2 / Assignment-Specification · GitLab
https://gitlab.cse.unsw.edu.a... 3/17
DeviceA and DeviceC are able to connect to the satellite as they are in view of the satellite. This is indicated by "possibleConnections":
["DeviceA","DeviceC"]" in the following world state (in JSON representation). An activation period of a device indicates the period during
which that device tries to establish connections to the available satellites. For this example, we initially assume that each device is dormant
(inactive), and therefore activation periods for each device is an empty list in the following world state. Later we will define activation periods
and use them in establishing connections.
{
"currentTime": "00:00",
"devices": [
{
"activationPeriods": [],
"id": "DeviceA",
"isConnected": false,
"position": 30,
"type": "HandheldDevice"
},
{
"activationPeriods": [],
"id": "DeviceB",
"isConnected": false,
"position": 180,
"type": "LaptopDevice"
},
{
"activationPeriods": [],
"id": "DeviceC",
"isConnected": false,
"position": 330,
"type": "DesktopDevice"
}
],
"satellites": [
{
"connections": [],
"height": 10000,
"id": "Satellite1",
"position": 20,
"possibleConnections": [
"DeviceA",
"DeviceC"
],
"type": "BlueOriginSatellite",
"velocity": 141.66
}
]
}
Now, using the velocity of the satellite (141.66 metres per minute, which at a height of 10,000m makes it have an angular velocity of 141.66 /
10,000 = 0.014 degrees per minute), we can calculate the new position of the satellite after a full day, as shown below in the figure (the
satellite has moved 20.4 degrees as per 141.66 / 10000 * 1440, this gives us a new position of 20 + 20.4 = 40.4 ). In this new position,
DeviceA and DeviceC are able to connect to the satellite and DeviceB is not able to connect to the satellite, because it is not in view of the
satellite.
NOTE: For the sake of this assignment we will not be worrying about radians at all. You can either visualise it as the fact that the linear
velocities already take into account the radian offset (π/180 or 180/π dependent on which way you are converting) or you can just say
that we are approximating them to be the same (radians == degrees). It doesn\'t matter and for this assignment we aren\'t really caring
about the math, we are focusing on your design!
2021/6/19 COMP2511 / 21T2 / Assignment-Specification · GitLab
https://gitlab.cse.unsw.edu.a... 4/17
The new world state for this position is
{
"currentTime": "00:00",
"devices": [
{
"activationPeriods": [],
"id": "DeviceA",
"isConnected": false,
"position": 30,
"type": "HandheldDevice"
},
{
"activationPeriods": [],
"id": "DeviceB",
"isConnected": false,
"position": 180,
"type": "LaptopDevice"
},
{
"activationPeriods": [],
"id": "DeviceC",
"isConnected": false,
"position": 330,
"type": "DesktopDevice"
}
],
"satellites": [
{
"connections": [],
"height": 10000,
"id": "Satellite1",
"position": 40.40
"possibleConnections": ["DeviceA", "DeviceC"],
"type": "BlueOriginSatellite",
"velocity": 141.66
}
]
}
Now, let\'s add the following activation periods:
DeviceA - "activationPeriods": [{ "startTime": "00:00", "endTime": "12:00" }]
DeviceB - "activationPeriods": [{ "startTime": "00:00", "endTime": "04:00" }]
DeviceC - "activationPeriods": [{ "startTime": "07:00", "endTime": "10:40" }]
Given the above activation periods, the world state at current time 03:00 will be as shown below. Please note that the following:
Device A is active at the current time of 03:00, and also in view of the satellite, so there is a connection between Device A and the satellite,
represented by a solid grey line.
Device C is not active at the current time of 03:00, and therefore there is no connection between the satellite and Device C.
Device B is active but not in a view of the satellite, so there is no connection for Device B.
2021/6/19 COMP2511 / 21T2 / Assignment-Specification · GitLab
https://gitlab.cse.unsw.edu.a... 5/17
We then can go forward to the time 10:00. At this point we have the following:
Device A is active at the current time of 10:00, and also in view of the satellite, so there is a connection between Device A and the satellite.
Device C is active at the current time of 10:00, and also in view of the satellite, so there is a connection between Device C and the satellite.
Device B is not active and not in a view of the satellite, so there is no connection for Device B.
Then, let\'s continue once more, and finish out the full day (so the current time is now 00:00 ). At this point both connections were completed
(at different times). The DeviceA connection ended after 12:00 since the device was no longer active. A similar case occurred for DeviceC where
the connection ended after 10:40 .
The world state here is as follows;
{
"currentTime": "00:00",
"devices": [
{
"activationPeriods": [{ "endTime": "12:00", "startTime": "00:00" }],
"id": "DeviceA",
"isConnected": false,
"position": 30,
"type": "HandheldDevice"
},
{
"activationPeriods": [{ "endTime": "04:00", "startTime": "00:00" }],
"id": "DeviceB",
"isConnected": false,
"position": 180,
"type": "LaptopDevice"
},
{
"activationPeriods": [{ "endTime": "10:40", "startTime": "07:00" }],
"id": "DeviceC",
2021/6/19 COMP2511 / 21T2 / Assignment-Specification · GitLab
https://gitlab.cse.unsw.edu.a... 6/17
"isConnected": false,
"position": 330,
"type": "DesktopDevice"
}
],
"satellites": [
{
"connections": [
{
"deviceId": "DeviceA",
"endTime": "12:01",
"minutesActive": 719,
"satelliteId": "Satellite1",
"startTime": "00:00"
},
{
"deviceId": "DeviceC",
"endTime": "10:41",
"minutesActive": 215,
"satelliteId": "Satellite1",
"startTime": "07:00"
}
],
"height": 10000,
"id": "Satellite1",
"position": 60.80,
"possibleConnections": ["DeviceA"],
"type": "BlueOriginSatellite",
"velocity": 141.66
}
]
}
Notice how DeviceC has only been active for 215 minutes but despite that has a start / end time that has a duration of 220 minutes (3 hrs and - mins = 180 + 40 = 220)! Even DeviceA has only been alive for 719 minutes despite having a duration of 720 minutes! Why the discrepency?
Well, as we\'ll find below in section 3, each device/satellite has a series of connection properties (amongst others) and in this case handhelds take - minute to connect, and desktops take 5 minutes to connect. Satellites can also effect this (for example SpaceX satellites connect instantly to
devices, but can only connect to handhelds).
Want to play around with this for a bit? You can use the following link which has this problem entirely setup already for you.
Visualising Simulation
A simulation is an incremental process starting with an initial world state, say WorldState_00. We add a specified time interval of 1 minute and
calculate the new positions of all the satellites after the minute. We then go and update all the connections accordingly to derive the next world
state WorldState_01. Similarly, we derive WorldState_02 from WorldState_01, WorldState_03 from WorldState_02, and so on. This act of feeding a
world state into the next forms a sort of state machine, akin to Conway\'s Game of Life in a way.
WorldState_00 -> WorldState_01 -> WorldState_02 -> …
You will not be solving ANY maths here; we will be providing a small library that solves all the mathematical details of this problem.
There are three tasks: - Implement the \'world state\', you\'ll be adding/moving devices, adding/removing satellites, and printing out where objects are in the world,
you WON\'T be simulating them yet. - Implement activation periods (where devices try to connect to satellites) and simulating the \'world state\' i.e. moving the satellites around,
and updating connections accordingly. - Implement special devices.
In this problem, we are going to have to make some assumptions. We will assume that:
We will only look at a single ring.
The ring is hollow.
Its radius is 3000 metres / 3 kilometres ( r ).
The ring does not rotate.
Simulation Requirements
Assumptions
2021/6/19 COMP2511 / 21T2 / Assignment-Specification · GitLab
https://gitlab.cse.unsw.edu.a... 7/17
We will represent all positions through their angle θ .
The satellites orbit around the disk in 2D space.
HandheldDevice – phones, GPS devices, tablets.
Handhelds take 1 minute to connect
LaptopDevice – laptop computers.
Laptops take 2 minutes to connect
DesktopDevice – desktop computers and servers.
Desktops take 5 minutes to connect
SpaceXSatellite
Orbits at a speed of 3330 metres per hour
Only connect to handheld devices
Infinite number of connections
Devices connect instantly
BlueOriginSatellite
Orbits at a speed of 8500 metres per hour
Supports all devices
Maximum of 5 laptops and 2 desktops at a time with no limit on handheld devices, however the absolute maximum of all devices at
any time is 10.WX:codehelp
以上是关于COMP2511 Back in Blackout的主要内容,如果未能解决你的问题,请参考以下文章
AtCoder Grand Contest 006 F - Blackout
What Didi’s Blackout Exposed About the Ride-Hailing Industry
UniMelb Comp30022 IT Project (Capstone) - 2.Vuforia in Unity