COMP2511 23T2 Assignment I Back in Blackout

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Assignment I: Back in Blackout

Due: Week 5 Friday, 5pm (30th June) Value: 15% of the Course Mark
What is this assignment aiming to achieve?
Assignment I is your first exposure to building a medium scale system from scratch. You’ll need to analyse the requirements, model the domain, and design a solution using the Object- Oriented Programming principles discussed in the course.
The aims of this assignment can be broken down into five major themes:
1. UnderstandingtheProblemSpace.Problemspacesinwhichwebuildsoftwarecan often be very complex. This assignment involves some geospatial and mathematical ideas (though you won’t have to do any mathematical derivation yourself) with a series of multifaceted interacting entities. Take some time to understand the problem by reading the spec a few times and clarifying anything you need to.
2. ThoughtfulPlanning.You’llneedtomodelthedomainbydefiningtheentitiespresentin the domain and their relationships. Start with a very rough pen and paper draft of this, you’ll be able to iterate on your design as you become more familiar with the problem space.
3. ProgrammingbyContract.Thespecificationoutlineseverythingyouhavetoimplement- you’ll need to implement your solution according to the rules and test your solution to ensure correctness.
4. RobustProgramming.Indevelopingthesystem,youwillneedtomaintaingoodquality programming practices including code style as well as the overall design. One approach you can take is, for each task, to implement a rough solution to pass the tests, go back and refactor and make it nicely designed. Then repeat for the next task.
5. BuildingBlocks.ThisassignmentwillbuildyourskillsinworkingwithJava,theVSCode IDE and thinking critically that will help you throughout the rest of the course.
Click here to login and access your personal assignment-i repository.
0. Change Log
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第1/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
1. Preamble and Problem
A great deal of today’s technology uses satellites which orbit the Earth in one way or another. For example, tagging photographs with their location, telecommunications, and even missile control systems. There are currently 4,550 active satellites (as of 2022) orbiting the Earth all together.
In the far future, society has become advanced to the point where they have begun to occupy a series of moons and asteroids around the planet Jupiter. Individuals rely on satellites for all their communication desires. Three major satellites exist around Jupiter.
This assessment aims to provide you with design experience for a non-trivial system. You will be architecting and modelling how these multiple satellites will communicate and function with various devices. The form of communication that you will be simulating is a simplified version of the modern internet, simply just file transfer. You can either upload a file to a satellite from a device, download a file from a satellite to a device, or send a file from a satellite to a satellite.
Your solution should adopt an Object-Oriented approach that utilises concepts such as abstraction, encapsulation, composition, and inheritance, as taught in lectures.
There is an introduction video available which you can watch – some of the contents of the video relates to a previous version of the assignment but most of it is relevant and gives you an in-depth overview of the tasks and starter code.
1.1 A simple example
Let’s assume initially there is a Standard Satellite at height approximately 80,000 km above the centre of Jupiter and at θ = 128 degrees. In addition there are 3 devices; Device A, Device B, and Device C. Device A and Device C are handheld devices, whereas Device B is a desktop device.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第2/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Simulatefo r 1/5/10/60*/120 Reload
Createslope
In this system, the satellite can talk to Device A and Device A can talk to the satellite (communication CreateSatellite
reateDevice
is done by sending files) since they are in range of each other. Satellite A however cannot talk to Satellite1
7 9 4 3 0 k m(9519km),127%
to Device C because it is not in visible sight range. The red line in the image highlights this.
on what devices they can talk to (discussed in more detail later). Finally, Satellite A cannot connect Device B (and Device B cannot talk to Satellite A) because Standard Satellite s have restrictions DeviceB
In this example, devices are static and will not move, but satellites can! Satellites move based on a
constant linear velocity, in this case Standard Satellites have a linear velocity of 2,500 km per minute
(or 2,500,000 metres). From this, we can calculate its angular velocity based on its height (which is
the radius from the center of Jupiter). For example, after 10 minutes it would have moved a total of DeviceC
2,500 / 80,000 * 10 mins = 0.03125 * 10 = 0.3125 radians ~= 18 degrees (note that we
don’t have to account for the fact they are measured in km here since the extra 10^3 component
will cancel out). This means our new position is 128 – 18 which is approximately 110-111
•Createslope
Sim ulattfo r
CreateSatellite
1 /5/10/60% /1
•CreateDevice
•Satellite1 480027km(101:16km),110°
Eventually after moving for a couple more minutes it will get out of range of the devices A and B.
Secondly, we need to look at interaction between satellites and devices. They can communicate
through the transfer of files. Files can be transferred between satellites/devices and other satellites
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第3/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
(files can not be directly sent from device to device).
To begin let’s create a new file on a device. Clicking on Device A and pressing Create File as shown below we can create a file.
DeviceInfo
DeviceID DeviceA DeviceTypeHandheldDevice
DeviceAngle126° Copy
SelectFile NoFilesfound
SendtoSatellite NoTargetsfound
Deletedevice CreateFile Close
Once created, files cannot be modified/deleted, furthermore every filename has to be unique. Creating a file called Halo Jupiter with its contents also being Halo Jupiter we can view it by going to the device again and clicking Open File as shown below.
HaloJupiter(size:12/12) HaloJupiter
We can then send this file to our satellite by just clicking on the device ensuring the file and satellite are selected as below then clicking Send File .
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第4/31⻚
CS Help, Email: tutorcs@163.com
Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
DeviceInfo DeviceIDDeviceA
DeviceTypeHandheldDevice
DeviceAngle126° SelectFile
HaloJupiter
If we then try to open the file on the satellite we notice that it is empty and says 0/12 for its size. This Satellite1
Sendto Satellite
is because files transfers aren’t instant, they are based on the bandwidth of the satellite. Standard
Satellites are relatively slow, sDoetleheteydweivllitcaeke 12 minutes to send this file since they only send at 1 CreateFile Close
byte per minute. If we let it run for at least 12 minutes and look again we will see the file has finished
HaloJupiter(size:0/12) OK
We could then continue this by running the simulation a little longer and letting the satellite orbit
around to Device C and then sending the file down to Device C.
1.2 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. A similar example of this is .
Play John Conway’s Game of Life
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第5/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
WorldState_00 -> WorldState_01 -> WorldState_02 -> …
In our case our simulation runs at an accuracy of 1 minute and each state transition will take only 1 minute.
2. Requirements
There are three tasks set out for you. 1. Modeltheproblem,including:
Modelling the satellites/devices;
Satellites/Devices must be able to be added/removed at runtime (with various consequences);
Most importantly, write a series of ‘queries’ about the current world state such as what devices currently exist.
1. Allowsatellites/devicestosendfilestoothersatellites.
2. Implementmovingdevices.
2.1 Assumptions
In this problem, we are going to have to make some assumptions. Let us assume that:
Satellites move around at a constant linear velocity regardless of their distance from the planet (their angular velocity would change based upon the distance, though).
The model is two dimensional
Objects do not rotate on their axis and simple planetary orbit is the only ‘rotation’ that is allowed in the system.
Jupiter has a radius of 69,911 kilometres. For the sake of consistency:
All distances are in kilometres ( 1 km = 1,000 m ).
Angular velocity is in radians per minute (not per second). Linear velocity is in kilometres per minute (not per second).
2.2 Devices
There are three types of devices available. Each device has a maximum range from which it can connect to satellites.
i NOTE: This problem will not require any heavy use of mathematics, you will be provided with a library that will perform all the calculations for you.
HandheldDevice – phones, GPS devices, tablets.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第6/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Handhelds have a range of only 50,000 kilometres (50,000,000 metres) LaptopDevice – laptop computers.
Laptops have a range of only 100,000 kilometres (100,000,000 metres) DesktopDevice – desktop computers and servers.
Desktops have a range of only 200,000 kilometres (200,000,000 metres)
Devices can store an infinite number of files and can upload/download files from satellites. Files are represented simply by just a string representing their content and a filename representing their name.
All files can be presumed to purely consist of alphanumeric characters or spaces (i.e. a-z, A-Z, 0-9, or spaces) and filenames can be presumed to be unique (i.e. we will never create two files of the same name with different content). Furthermore, since we are dealing with such a simple subset, 1 character is equivalent to 1 byte. We will often refer to the size of files in terms of bytes, and the file size only relates to the content of the file (and not the filename).
To send files the target needs to be within the range of the source BUT the source does not have to be within the range of the target. For example, if a HandheldDevice (range 50,000 km ) is 100,000
km away from a StandardSatellite (range 150,000 km ) it can’t send files to the satellite but it can receive files from the satellite. If the device is 160,000 km away from the satellite neither can interact with each other. Satellites can also send files to other satellites but devices can not send files to other devices.
Files do not send instantly however, and are limited by the bandwidth of the satellites. Satellites will always ensure fairness and will evenly allocate bandwidth to all currently uploading files (for example, if a satellite has a bandwidth of 10 bytes per minute and 3 files, every file will get 3 bytes per minute. You’ll have 1 unused byte of bandwidth). Devices aren’t limited on the number of downloads/uploads they can do.
If a device goes out of range of a satellite during the transfer of a file (either way) the partially downloaded file should be removed from the recipient. This does raise the question of whether or not you should start transferring a file if it’s obvious that it won’t finish. Solving this problem is mostly algorithmic and isn’t particularly interesting to the point of this assignment so you don’t have to do anything special here: if someone asks to transfer a file… begin to transfer it.
During a file transfer, in the case where sending speed and receiving speed are different, the transfer rate is bottlenecked by min(sending speed, receiving speed) .
2.4 Satellites
There are 2 specialised types of satellites (and one basic one). Satellites have a set amount of bandwidth for transferring files and a set amount of storage.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第7/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Default direction for all satellites is negative (clockwise), unless otherwise specified.
StandardSatellite
Moves at a linear speed of 2,500 kilometres (2,500,000 metres) per minute
Supports handhelds and laptops only (along with other satellites)
Maximum range of 150,000 kilometres (150,000,000 metres)
Can store up to either 3 files or 80 bytes (whichever is smallest for the current situation). Can receive 1 byte per minute and can send 1 byte per minute meaning it can only transfer 1 file at a time.
TeleportingSatellite
Moves at a linear speed of 1,000 kilometres (1,000,000 metres) per minute Supports all devices
Maximum range of 200,000 kilometres (200,000,000 metres)
Can receive 15 bytes per minute and can send 10 bytes per minute.
Can store up to 200 bytes and as many files as fits into that space.
When the position of the satellite reaches θ = 180, the satellite teleports to θ = 0 and changes direction.
If a file transfer from a satellite to a device or a satellite to another satellite is in progress when the satellite teleports, the rest of the file is instantly downloaded, however all “t” letter bytes are removed from the remaining bytes to be sent.
For the satellite to satellite case, the behaviour is the same whether it is the sender or
receiving that is teleporting
If a file transfer from a device to a satellite is in progress when the satellite teleports, the
download fails and the partially uploaded file is removed from the satellite, and all “t” letter bytes are removed from the file on the device.
There is no ‘correction’ with the position after a teleport occurs as there is for Relay Satellites (see below). Once the satellite teleports to θ = 0 it does not continue moving for the remainder of the tick.
Teleporting satellites start by moving anticlockwise.
RelaySatellite
Moves at a linear velocity of 1,500 kilometres (1,500,000 metres) per minute Supports all devices
Max range of 300,000 kilometres (300,000,000 metres)
Cannot store any files and has no bandwidth limits
Devices/Satellites cannot transfer files directly to a relay but instead a relay can be automatically used by satellites/devices to send to their real target.
For example if a HandheldDevice (range 50,000km ) is 200,000km away from a StandardSatellite that it wishes to communicate with, it is able to communicate to the satellite through the use of the relay if the relay is within 50,000km of the device and the
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第8/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
satellite is within 300,000km (the range of the relay) of the relay.
Files being transferred through a relay should not show up in the relay’s list of files.
Only travels in the region between 140° and 190°
When it reaches one side of the region its direction reverses and it travels in the opposite direction.
This ‘correction’ will only apply on the next minute. This means that it can briefly exceed this boundary. There is a unit test that details this behaviour quite well-called
testRelaySatelliteMovement in Task2ExampleTests.java
You can either do the radian maths here yourself or use the functions in src/unsw/utils/Angle.java to do comparisons.
In the case that the satellite doesn’t start in the region [140°, 190°] , it should choose whatever direction gets it to the region [140°, 190°] in the shortest amount of time.
As a hint (and to prevent you having to do maths) this ‘threshold’ angle is 345° ; if a relay satellite starts on the threshold 345° it should take the positive direction.
You can assume that we don’t create any satellite at 140 and 190 degree in our tests
(this behaviour’s undefined).
Relay satellites don’t allow you to ignore satellite requirements (other than visibility/range), for example you can’t send a file from a Desktop Device to a Standard Satellite due to the fact that a Standard Satellite doesn’t support Desktops. This should hold even if a Relay is used along the way.
HINT: because there are no bandwidth limits and you don’t have to show any tracking of files that go through the relay. Keep it simple! Don’t over-engineer a solution for this one. You’ll notice that the frontend when drawing connections that utilise relays don’t go through the relay as shown below.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第9/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Q186523km(16612km),132°
i To save you some googling v = r * ω (where v is linear velocity i.e. kilometres per minute, ω is angular velocity i.e. radians per minute, and r is the radius / height of the satellite in km). RELAY
2.5 Visualisation
To help you understand this problem we’ve made a frontend for the application you are writing, we also have a sample implementation for you to refer to. You’ll also find that the starter code will have a simple webserver to run this frontend for you (already written) such that you can run the UI locally. Cuté
Assignment Sample Implementation
This is NOT necessary for you to get marks, and it is more there just for those that enjoy seeing something slowly come together as they complete tasks. It’s possible and still quite nice to just use the reference implementation + JUnit tests to design and build your solution without ever having to run and test the UI locally.
⚠ As with any software, bugs could exist in either the frontend or the sample implementation. Thus you should treat the specification as the final word and not the sample implementation. If you do notice any bugs or issues, please raise it on the forum so it can get fixed (or a workaround will be provided). Furthermore as the frontend expects that most of the code follows the specification you may run into weird bugs if you have wildly different behaviour.
Functionality is listed below;
You can click on a satellite or a device to view its properties, as well as all the files it currently has, send files to other satellites, create files if it’s a device, delete the entity as well as copy the numbers to help in your testing.
You can mouse over any satellite/device to see all the possible targets
You can click on anything near the radius of Jupiter to create a device and anywhere else in space to create a satellite
You can also use the buttons in the top left to create device or satellite at an exact position/height There are buttons on the top left to refresh the screen (for whatever reason) as well as run
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第10/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
simulations for set periods of time
CreateSatellite CreateDevice
sim ulatefo r :1/5/10|60/120 •Createslope
Click anywhere on screen to make a device/satellite or use the buttons in the top left
If your backend throws any exceptions an error will popup in the UI and an error log will be in the Java output window in VSCode (except for transferring file tasks which require the throwing of certain exceptions).
3. Program Structure
77416km(7505km),70
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第11/31⻚
Programming Help, Add QQ: 749389476
Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Description
Should you need to modify this?
Contains one method for each command you need to implement.
BlackoutController.jav a
src/unsw/blackout/Blac koutController.java
Runs a server for blackout.
src/App.java
Contains all the math logic that you’ll require.
MathsHelper.java
src/unsw/utils/MathsHe lper.java
Contains an abstraction for angles that lets you easily convert between radians/degrees without having to worry about what ‘state’ it is currently in.
Angle.java
src/unsw/utils/Angle.j ava
Contains the result for certain functions in BlackoutController.
EntityInfoResponse.jav a and FileInfoResponse.java
src/unsw/response/mode ls/EntityInfoResponse. java and src/unsw/response/mode ls/FileInfoResponse.ja va
Scintilla.java and auxiliary files;
Environment.java ,
PlatformUtils.java , and WebServer.java
Contains a small custom built wrapper around Spark-Java for running a web server. When run it automatically opens a web browser.
src/scintilla
Contains a simple test to get you started with Task 1.
Yes, feel free to add more tests here or just create a new testing file.
Task1ExampleTests.jav a
src/test/Task1ExampleT ests.java
Contains a simple test to get you started with Task 2.
Yes, feel free to add more tests here or just create a new testing file.
Task2ExampleTests.jav a
src/test/Task2ExampleT ests.java
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第12/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Task 1 – Modelling (15%)
This task is mainly focused on design, if you start with an initial design via a rough UML Diagram on pen and paper, you’ll find this will be quite straightforward! Very little logic exists in this first task.
All methods below exist in the class src/unsw/blackout/BlackoutController.java Task 1 a) Create Device
Adds a device to the ring at the position specified, the position is measured as an angle relative to the x-axis, rotating anticlockwise.
1 public void createDevice(String deviceId, String type, Angle position);
Task 1 b) Remove Device
Removes a device (specified by id). You don’t need to cancel all current downloads/uploads (relevant for Task 2).
1 public void removeDevice(String deviceId);
Task 1 c) Create Satellite
Creates a satellite at a given height (measured from centre of Jupiter) at a given angle.
1 public void createSatellite(String satelliteId, String type, 2 double height, Angle position);
Task 1 d) Remove Satellite
Removes a satellite from orbit. You don’t need to cancel all current downloads/uploads (relevant for Task 2).
1 public void removeSatellite(String satelliteId);
Task 1 e) List all device ids
Lists all the device ids that currently exist.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第13/31⻚
Code Help, Add WeChat: cstutorcs
Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
1 public List listDeviceIds();
Task 1 f) List all satellite ids
Lists all the satellite ids that currently exist.
1 public List listSatelliteIds();
Task 1 g) Add file to device
Adds a file to a device (not a satellite). Files are added instantly.
1 public void addFileToDevice(String deviceId, String filename, String content);
Task 1 h) Get device/satellite information
Get detailed information about a single device or a satellite.
i NOTE: id s are unique, so no 2 devices and/or satellites can have the same id.
1 public EntityInfoResponse getInfo(String id);
EntityInfoResponse is a struct that is supplied that contains the following members (it also comes with a constructor and a getter).
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第14/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence
2023/6/30 09:55
1 2 3 4 5 6 7 8
public final class EntityInfoResponse { /**
* The unique ID of the device.
private final String id;
* The angular position of the entity in radians
COMP2511 23T2 / Assignment I: Back in Blackout
private final Angle position;
* The height of the entity measured in kilometres
* devices will have a height equal to the radius of Jupiter.
private final double height;
* the type of the entity i.e. DesktopDevice, StandardSatellite, …
private final String type;
* A map of all the files that this entity has access to.
* The key is the name of the file.
private final Map files; }
i NOTE: final for classes means it can’t have subclasses, final for functions means they can’t have overrides, and final for members means they can’t be modified after the constructor. You don’t have to use it in the assignment.
Map<..> is similar to Dictionaries in Python and acts as a mapping between a key and a value. You can find more information
Map (Java Platform SE 8 )
Task 1 Example
You can test your implementations for Task 1 using the simple test provided in the file src/test/Task1ExampleTests.java . Later you need to add more tests to properly test your
implementations.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
The method testExample uses a JUnit test to test a few world states. Please read the method testExample .
2 public void testExample() throws FileTransferException {
3 // Task 1
4 // Example from the specification
5 BlackoutController controller = new BlackoutController();
7 // Creates 1 satellite and 2 devices
8 // Gets a device to send a file to a satellites and gets another device to do
9 // StandardSatellites are slow and transfer 1 byte per minute.
10 controller.createSatellite(“Satellite1”, “StandardSatellite”, 10000 + RADIUS_
11 controller.createDevice(“DeviceB”, “LaptopDevice”, Angle.fromDegrees(310));
12 controller.createDevice(“DeviceC”, “HandheldDevice”, Angle.fromDegrees(320));
14 String msg = “Hi 42”;
15 controller.addFileToDevice(“DeviceC”, “FileAlpha”, msg);
16 controller.sendFile(“FileAlpha”, “DeviceC”, “Satellite1”);
17 assertEquals(new FileInfoResponse(“FileAlpha”, “”, msg.length(), false), cont
19 controller.simulate(msg.length());
20 assertEquals(new FileInfoResponse(“FileAlpha”, msg, msg.length(), true), cont
22 controller.sendFile(“FileAlpha”, “Satellite1”, “DeviceB”);
23 assertEquals(new FileInfoResponse(“FileAlpha”, “”, msg.length(), false), cont
25 controller.simulate(msg.length());
26 assertEquals(new FileInfoResponse(“FileAlpha”, msg, msg.length(), true), cont
28 // Hints for further testing:
29 // – What about checking about the progress of the message half way through?
30 // – Device/s get out of range of satellite
31 // … and so on.
Task 2 – Simulation (25%)
The second tasks involves the actual simulating of the movement of satellites and transferring files.
Task 2 a) Run the Simulation
This should run the simulation for a single minute. This will include moving satellites around and later on transferring files between satellites and devices.
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第16/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
1 public void simulate();
i NOTE: To help with testing a simulate(int numberOfMinutes) has already been written which just calls simulate() numberOfMinutes ‘ times
Task 2 b) List all entities in range
Lists every entity in range of the specified entity that can communicate. Devices can only communicate with certain satellites (as specified in the Satellites section). Satellites can communicate with every satellite and a certain subset of devices (once again as discussed in the Satellites section).
For an entity to be in range it also has to be visible to the other entities (i.e. if you drew a line between the two entities that line cannot go through Jupiter). Relay satellites allow you to reach entities that were otherwise invisible due to position/range, so long as the entity is visible to the relay satellite. In the example below, satellite 1 and device B and C are not visible to each other initially, adding relay satellites (R1, R2 and R3) make them fall in range of each other
1 public List communicableEntitiesInRange(String id);
https://unswcse.atlassian.net/wiki/spaces/C2/pages/187793419/Assignment+I+Back+in+Blackout 第17/31⻚

Assignment I: Back in Blackout – COMP2511 23T2 – Confluence 2023/6/30 09:55
Checkout src/unsw/blackout/utils/MathHelper there are some very useful functions there that do the vast majority of the work for you, you shouldn’t need to figure out any complicated maths.
i This is useful for 2c.
Task 2 c) File Transferring
Devices/Satellites can