Skip to content

Commit 5e7cc79

Browse files
First release
1 parent 549512f commit 5e7cc79

File tree

308 files changed

+51416
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+51416
-0
lines changed

00_random_action.ipynb

Lines changed: 570 additions & 0 deletions
Large diffs are not rendered by default.

01_qambo_ddqn.ipynb

Lines changed: 810 additions & 0 deletions
Large diffs are not rendered by default.

02_qambo_d3qn.ipynb

Lines changed: 833 additions & 0 deletions
Large diffs are not rendered by default.

03_qambo_noisy_3dqn.ipynb

Lines changed: 947 additions & 0 deletions
Large diffs are not rendered by default.

04_qambo_noisy_ddqn.ipynb

Lines changed: 814 additions & 0 deletions
Large diffs are not rendered by default.

05_qambo_prioritised_replay_d3qn.ipynb

Lines changed: 903 additions & 0 deletions
Large diffs are not rendered by default.

06_qambo_prioritised_replay_noisy_3dqn.ipynb

Lines changed: 1017 additions & 0 deletions
Large diffs are not rendered by default.

07_qambo_bagging_ddqn.ipynb

Lines changed: 830 additions & 0 deletions
Large diffs are not rendered by default.

08_qambo_bagging_d3qn.ipynb

Lines changed: 860 additions & 0 deletions
Large diffs are not rendered by default.

09_qambo_noisy_bagging_ddqn.ipynb

Lines changed: 861 additions & 0 deletions
Large diffs are not rendered by default.

10_qambo_noisy_bagging_3dqn.ipynb

Lines changed: 974 additions & 0 deletions
Large diffs are not rendered by default.

11_qambo_noisy_bagging_prioritised_3dqn.ipynb

Lines changed: 1049 additions & 0 deletions
Large diffs are not rendered by default.

amboworld/.ipynb_checkpoints/environment-checkpoint.py

Lines changed: 655 additions & 0 deletions
Large diffs are not rendered by default.

amboworld/__init__.py

Whitespace-only changes.
152 Bytes
Binary file not shown.
1.87 KB
Binary file not shown.
Binary file not shown.
1.67 KB
Binary file not shown.
368 Bytes
Binary file not shown.

amboworld/ambulance.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import random
2+
3+
class Ambulance():
4+
"""
5+
Class for an individual ambulance.
6+
7+
Parameters
8+
----------
9+
_env (object):
10+
Reference to environment object
11+
12+
ambulance_id (int):
13+
Unique ambulance ID
14+
assigned_dispatch_point (int):
15+
Currently assigned dispatch point
16+
at_dispatch_point (bool):
17+
Ambulance free and at dispatch point
18+
free (bool):
19+
Ambulance is currently free and may attend patient incidents
20+
travelling_to_disptach point (bool)
21+
Ambulance is free and travelling to dispatch point
22+
travelling_to_hospital (bool):
23+
Travelling to hospital with patient on board
24+
travelling_to_patient (bool):
25+
Travelling to patient incident
26+
27+
Methods
28+
-------
29+
__init__():
30+
Constructor method
31+
32+
"""
33+
34+
# Count of ambulances
35+
ambulance_count = 0
36+
37+
def __init__(self, env,ambulance_id):
38+
"""
39+
Constructor class for individual ambulance. Start at different random points each time
40+
"""
41+
42+
self._env = env
43+
self.ambulance_id = ambulance_id
44+
# Set starting position (random allocation)
45+
random.seed()
46+
self.dispatch_point = random.randint(0, self._env.number_dispatch_points -1)
47+
self.dispatch_x = self._env.dispatch_points[self.dispatch_point][0]
48+
self.dispatch_y = self._env.dispatch_points[self.dispatch_point][0]
49+
self.current_x = self.dispatch_x
50+
self.current_y = self.dispatch_y
51+
# Set starting status
52+
self.free = True
53+
self.at_hospital = False
54+
self.at_dispatch_point = True
55+
self.time_journey_start = None
56+
self.travelling_to_dispatch_point = False
57+
self.travelling_to_hospital = False
58+
self.travelling_to_patient = False
59+
self.journey_time = None
60+
self.start_x = None
61+
self.start_y = None
62+
self.target_x = None
63+
self.target_y = None

0 commit comments

Comments
 (0)