Merge remote-tracking branch 'origin/develop' into feature/setup
# Conflicts: # README.md
Tento commit je obsažen v:
40
README.md
40
README.md
@@ -19,6 +19,46 @@ This component provides the server backend with the planning and optimization sy
|
||||
It is designed as a python framework that can run on a webserver.
|
||||
ZMQ based encryption and authentication methods are used to authenticate controllers.
|
||||
|
||||
## RHC-ACS-ASS Algorithm
|
||||
Step 1: Initialization. Set up parameters for
|
||||
the RHC, and set the current receding horizon k = 1.
|
||||
|
||||
Step 2: Find out all the M aircraft whose PLTs belong to
|
||||
the kth receding horizon.
|
||||
|
||||
Step 3: Schedule the M aircraft in the kth receding horizon
|
||||
by using an ACS.
|
||||
|
||||
Step 4: Assign the aircraft whose ALTs belong to kth scheduled window ω(k) to land on
|
||||
the runway.
|
||||
|
||||
Step 5: Modify the PLT for those aircraft whose PLT belongs to ω(k) but the ALT does not belong to ω(k). The modification is to set their PLT to kTTI, making them belong to Ω(k + 1), such that they can be scheduled in the next receding horizon.
|
||||
|
||||
Step 6: Termination check. When all the aircraft have been assigned to land at the runway, the algorithm terminates. Otherwise, set k = k + 1 and go to Step 2 for the next receding horizon optimization.
|
||||
|
||||
|
||||
|
||||
In the preceding steps, Step 3 is the major process of the
|
||||
algorithm. The flowchart is illustrated on the right side of Fig. 3,
|
||||
and the details are given below.
|
||||
|
||||
Step 3.1: Schedule the M aircraft by the FCFS approach and
|
||||
calculate the fitness value through (3). Calculate
|
||||
the initial pheromone τ0 and set the pheromone for
|
||||
each aircraft pair as τ0.
|
||||
|
||||
Step 3.2: For each ant, do the following.
|
||||
|
||||
a) Determine the first landing aircraft s and construct the whole landing sequence using the state transition rule as (5) and (6).
|
||||
|
||||
b) Perform the local pheromone updating as (9).
|
||||
|
||||
Step 3.3: Calculate the fitness of each ant and determine
|
||||
the best solution. Moreover, the current best solution is compared with the historically best solution
|
||||
to determine the historically best solution.
|
||||
|
||||
Step 3.4: Perform the global pheromone updating as (10).
|
||||
|
||||
# Additional libraries
|
||||
|
||||
* [ZeroMQ](https://github.com/zeromq) - GNU GPLv3
|
||||
|
||||
18
algorithm/rhcacsass.py
Normální soubor
18
algorithm/rhcacsass.py
Normální soubor
@@ -0,0 +1,18 @@
|
||||
# RHC-ACS-ASS Algorithm
|
||||
# This class is written to contain an implementation
|
||||
# of the Ant Colony System based upon the Receding Horizon
|
||||
# for Aircraft Arrival Sequencing
|
||||
|
||||
class RhcAcsAss:
|
||||
k = 1 # Receding horizon counter
|
||||
N_rhc = 4 # The number of receding horizons
|
||||
T_ti = 1 # The scheduling window
|
||||
|
||||
def __init__(self, n, t):
|
||||
self.N_rhc = n
|
||||
self.T_ti = t
|
||||
|
||||
def find_aircraft_for_horizon(self, ki):
|
||||
# Omega(k) = [(k-1) * T_ti, (k+N_rhc-1) * T_ti]
|
||||
pass
|
||||
|
||||
22
icao/recat.py
Normální soubor
22
icao/recat.py
Normální soubor
@@ -0,0 +1,22 @@
|
||||
# Recat departure separation in seconds
|
||||
# x = CAT A -> CAT F
|
||||
# y = CAT A -> CAT F
|
||||
# https://www.skybrary.aero/index.php/RECAT_-_Wake_Turbulence_Re-categorisation
|
||||
recatDeparture = [
|
||||
[0, 100, 120, 140, 160, 180],
|
||||
[0, 0, 0, 100, 120, 140],
|
||||
[0, 0, 0, 80, 100, 120],
|
||||
[0, 0, 0, 0, 0, 120],
|
||||
[0, 0, 0, 0, 0, 100],
|
||||
[0, 0, 0, 0, 0, 80],
|
||||
]
|
||||
|
||||
#Recat Arrival in NM
|
||||
recatArrival = [
|
||||
[3, 4, 5, 5, 6, 8],
|
||||
[0, 3, 4, 4, 5, 7],
|
||||
[0, 0, 3, 3, 4, 6],
|
||||
[0, 0, 0, 0, 0, 5],
|
||||
[0, 0, 0, 0, 0, 4],
|
||||
[0, 0, 0, 0, 0, 3],
|
||||
]
|
||||
10
main.py
Normální soubor
10
main.py
Normální soubor
@@ -0,0 +1,10 @@
|
||||
from tcp.TCPServer import TCPServer
|
||||
|
||||
|
||||
def main():
|
||||
server = TCPServer()
|
||||
server.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
51
tcp/TCPServer.py
Normální soubor
51
tcp/TCPServer.py
Normální soubor
@@ -0,0 +1,51 @@
|
||||
import socket
|
||||
import _thread
|
||||
|
||||
|
||||
class TCPServer(socket.socket):
|
||||
clients = []
|
||||
|
||||
def __init__(self):
|
||||
socket.socket.__init__(self)
|
||||
self.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.bind(('0.0.0.0', 8765))
|
||||
self.listen(5)
|
||||
|
||||
def run(self):
|
||||
print("Starting TCP Server")
|
||||
try:
|
||||
self.accept_clients()
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
finally:
|
||||
print("Server shutdown")
|
||||
for client in self.clients:
|
||||
client.close()
|
||||
self.close()
|
||||
|
||||
def accept_clients(self):
|
||||
while True:
|
||||
(client_socket, address) = self.accept()
|
||||
self.clients.append(client_socket)
|
||||
self.on_open(client_socket)
|
||||
_thread.start_new_thread(self.receive, (client_socket,))
|
||||
|
||||
def receive(self, client):
|
||||
while True:
|
||||
data = client.recv(1024)
|
||||
if data == '':
|
||||
break
|
||||
self.on_message(client, data)
|
||||
self.clients.remove(client)
|
||||
self.on_close(client)
|
||||
client.close()
|
||||
_thread.exit()
|
||||
|
||||
def on_open(self, client):
|
||||
pass
|
||||
|
||||
def on_message(self, client, message):
|
||||
pass
|
||||
|
||||
def on_close(self, client):
|
||||
pass
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele