Vars
This commit is contained in:
parent
1c180e323d
commit
3be959abbe
36
main.py
36
main.py
|
@ -1,3 +1,39 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import math
|
||||||
|
|
||||||
print("#hashcode2016")
|
print("#hashcode2016")
|
||||||
|
|
||||||
|
X = 0 # Nb rows
|
||||||
|
Y = 0 # Nb columns
|
||||||
|
D = 0 # Nb drones
|
||||||
|
T = 0 # Deadline
|
||||||
|
M = 0 # Maximum load
|
||||||
|
P = 0 # Nb products
|
||||||
|
W = 0 # Nb warehouses
|
||||||
|
C = 0 # Nb customers
|
||||||
|
|
||||||
|
Dp = []; # Positions of drones
|
||||||
|
# (x, y)
|
||||||
|
Di = []; # Items of drones
|
||||||
|
# {product number: qt}
|
||||||
|
Dd = []; # Turn avaibility of drone
|
||||||
|
# int
|
||||||
|
|
||||||
|
Pw = []; # Weight of products
|
||||||
|
# int
|
||||||
|
|
||||||
|
Wp = []; # Positions of warehouses
|
||||||
|
# (x, y)
|
||||||
|
Wi = []; # Items of warehouses
|
||||||
|
# {product number: qt}
|
||||||
|
|
||||||
|
Cp = []; # Positions of customers
|
||||||
|
# (x, y)
|
||||||
|
Ci = []; # Needs of customers
|
||||||
|
# {product number: qt}
|
||||||
|
|
||||||
|
def distance(A, B):
|
||||||
|
return math.ceil(sqrt(pow((B[0] - A[0], 2) + pow(B[1] - A[1], 2))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue