23.4.08

TripScript update

The idea is to choose big, dynamic cities in Poland and search there for interesting, accurate memorials and edge conditions.


# Selection of transport

Transport = [train, car, bus]


For each element in Transport:

_____check_cost.


Function check_cost:

If element=car:

_____start check_cost.car.

If element=train:

_____start check_cost.train.

If element=plane:

_____start check_cost.plane.


Function check_cost.car

cost = (((combustion x distance) x price_of_gas) + price_of_renting???)/number_of_participants

# driver needed

Put cost.car into Costs = []


Function check_cost.train

number_of_passangers = (5, 9)

cost = ticket_1_to_2 + ticket_2_to_3 + ...


ticket_Dessau_Berlin

If number_of_passengers <= 5:

_____buy 1 Brandenburger ticket

_____then cost = cost_of_ticket/number_of_passengers

Else:

_____buy 2 Brandenburger tickets

_____then cost = 2 x cost_of_ticket/number_of_passengers


ticket_Berlin_Frankfurt

cost = const. = xx euro


ticket_Frankfurt_CityInPoland

cost = const. = xx euro


ticket_CityInPoland_Berlin

cost = const. = about 30 euro


Put cost.train into Costs = []


Function check_cost.bus

number_of_passangers = (5, 9)

cost = ticket_1_to_2 + ticket_2_to_3 + ... # (to be adjusted)


Put cost.car into Costs = []


Costs = [cost.car, cost.train, cost.bus]

From Costs choose the cheapest element.


### Process of city selection


Take a map of Poland.

If city.population >= 500 000 or city is in Unesco list

_____add city to List1

Else: ignore

city += 1


# now I have a list of cities selected by population

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


# Hostels

date_of arrival = date1

date_of_departure = date2

For each city in List2, check city.hostePrice and city.hostel.availability

If city.hostelPrice <= 20euro and hostel.availability is from date_of_arrival to date_of_departure,

book a room

Else: ignore


### process


Routes = [Route1, Route2, Route3]

From Routes choose random element and run it.


Route_general: Dessau --> City1 --> City 2 --> ... --> City n --> return.

Route 1: Dessau --> Berlin --> visit 5 sites --> cities in Poland --> visit Berlin --> return

Route 2: Dessau --> visit Berlin --> visit 5 sites --> cities in Poland --> return

Route 3: Dessau --> Berlin --> cities in Poland --> visit 5 sites --> visit Berlin --> return.



# Start

From Dessau go to City1

List_of_activities = [..., ..., ..., ...]

Loop:

_____From List_of_activities: choose place within shortest distance

_____run.

_____Delete from List_of_activities.

_____Activity += 1


_____After each acitivity:

__________If time <= 10PM: #(or any hour)

_______________continue,

__________Else:

_______________if tired:

____________________go back to hostel and sleep.

_______________Else:

____________________go on a party and then to hostel ;-)

__________If feeling hungry:

_______________eat

__________Else:

_______________continue.


If List_of_activities = empty,

_____go to next city from List_of_cities.

_____If List_of cities = empty:

__________go back to Dessau,

_____Else:

__________continue.


End of loop.



No comments: