20.4.08

Script

Memorial Script


# defining variables

T – transport (t1 = train, t2 = car, t3 = plane, t4 = boat?)

M – money

D – duration

warsaw = Warsaw ((x, y, z), hostel 12E, population 1 700 000, memorials=n)

krakow = Krakow ((x, y, z), hostel , population 750 000, memorials=n)

wroclaw = Wroclaw ((x, y, z), hostel, population, memorials=n )


Constants:

Kiev 1st Mai

Schengen border

Be back on 5th


Data about hostels and train timetables are given as external content.




### Scheme 1

# From Berlin go to a border.

# Visit 5 sites.

# Cross the boarder.

# Get to a city in Poland.

# Cross Schengen border.

# Go to Kiev (1st Mai)

# Return to Berlin before 5th Mai.


### Scheme 2 – now more realistic

# From Berlin get to Kiev, crossing Schengen border. (1st Mai) (if by train or car)

# Go to a city in Poland, crossing Schengen boarder. (if previous by airplane)

# Cross de-pl border

# Visit 5 sites.

# Go to Berlin/Dessau.


Check train connection from Berlin to Kiev.

If journey.time >= 12hours,

break and search for a plane

Else:

buy a ticket/reserve seats.


### Process of city selection

# First step

Take a map of Europe.

Draw line connecting Berlin and Kiev.

line: y = ax + b

If city.population >= 500 000 and city.location <= 50km from line

add city to List1

Else:

ignore

city += 1


# now I have a list of cities selected by location and population

List1 = [city1, city2, city3, city4, ...]


# Second step

For each city in List1, check city.numberofmemorials.

If city.numberofmemorials >= 10

add to List2

Else:

ignore

# Now I have a list of cities with a sufficient number of memorials.


#Third step

For each city in List2, check city.hosteprice and availability

If city.hostelprice <= 20E and hostel is available from a to b,

add city to SelectedCities

Else:

ignore


#To finally select a city, I can choose it by the largest number of memorials

from SelectedCities choose city with city.numberofmemorials --> maximum.



### Train connections

Check train connection from city.actual to city.next

If train leaves in 1h:

if it is 13-15h:

go for lunch,

else:

go for coffee.

Else:

go home and return at appopriate time.


### Loop for a city

(necessary morning activity omitted)

List of acivities = [...., ...., ...., ....]

Make activity 1.

Check time after each activity.

If time=enough for next activity,

continue

Else:

break and go back to hostel.



No comments: