# Path: route_model/choice_set/generate_choice_set.py
# def generate_choice_set(G,chosen,choice_set_config,link_randomizer=None,time_dependent_relation=None,trip_time=None,ext_bound=None):
# 	
# 	config=choice_set_config
# 	
# 	if config['method']=='link_elimination':
# 		return le_generate(G,chosen,config)
# 		
# 	if config['method']=='doubly_stochastic':
# 		return ds_generate(G,chosen,config,link_randomizer,ext_bound,time_dependent_relation,trip_time)


import os, csv, sys
import route_model.misc as rm_misc
import route_model.input as rm_input
import route_model.output as rm_output
import route_model.choice_set.ds_generate as ds
import time
import random
import numpy
from optparse import OptionParser
from transport_network import TransportNetwork, create_pseudo_dual
from route_model.choice_set.generate_choice_set import generate_choice_set
from multiprocessing import Lock, Process, current_process, Queue
		for trip_id in trip_ids:
			idx=idx+1
			print time.asctime(time.localtime()), "-", current_process().name, "-",idx, ", k: ", kappa, ", s: ", sigma ,". trip_id: ", trip_id[0], ", sub_trip: ", trip_id[1], ", stage: ", trip_id[2]
			the_set,chosen_overlap=generate_choice_set(this_network,trip_data[trip_id],master_config.choice_set_config,link_randomizer,master_config['time_dependent_relation'],trip_times[trip_id[0]],ext_bound)
			overlap_sum=overlap_sum+chosen_overlap
		
		done_queue.put((kappa,sigma,overlap_sum/idx))
		
	done_queue.put('STOP')
	return True

if __name__ == '__main__':
	
	parser=OptionParser()
	parser.add_option("-m", dest="master_config",help="python path to master configuration module")
	(options, args)=parser.parse_args()
	
	print time.asctime(time.localtime())
	
	mandatory=['master_config']
	for m in mandatory:
		if not options.__dict__[m]:
			parser.print_help()
			sys.exit()
			
	#set up
	master_config=rm_misc.get_class_instance_from_python_path(options.master_config)
	prelim_network=TransportNetwork(master_config.network_config)
	
	#exclude links

# Path: route_model/choice_set/generate_choice_set.py
# def generate_choice_set(G,chosen,choice_set_config,link_randomizer=None,time_dependent_relation=None,trip_time=None,ext_bound=None):
# 	
# 	config=choice_set_config
# 	
# 	if config['method']=='link_elimination':
# 		return le_generate(G,chosen,config)
# 		
# 	if config['method']=='doubly_stochastic':
# 		return ds_generate(G,chosen,config,link_randomizer,ext_bound,time_dependent_relation,trip_time)


# Path: route_model/evaluate_parameters.py
import os, csv, sys
import route_model.misc as rm_misc
import route_model.input as rm_input
import route_model.output as rm_output
import route_model.choice_set.ds_generate as ds
import time
import random
import numpy
from optparse import OptionParser
from transport_network import TransportNetwork, create_pseudo_dual
from route_model.choice_set.generate_choice_set import generate_choice_set
from multiprocessing import Lock, Process, current_process, Queue

		for trip_id in trip_ids:
			idx=idx+1
			print time.asctime(time.localtime()), "-", current_process().name, "-",idx, ", k: ", kappa, ", s: ", sigma ,". trip_id: ", trip_id[0], ", sub_trip: ", trip_id[1], ", stage: ", trip_id[2]
			the_set,chosen_overlap=generate_choice_set(this_network,trip_data[trip_id],master_config.choice_set_config,link_randomizer,master_config['time_dependent_relation'],trip_times[trip_id[0]],ext_bound)
			overlap_sum=overlap_sum+chosen_overlap
		
		done_queue.put((kappa,sigma,overlap_sum/idx))
		
	done_queue.put('STOP')
	return True

if __name__ == '__main__':
	
	parser=OptionParser()
	parser.add_option("-m", dest="master_config",help="python path to master configuration module")
	(options, args)=parser.parse_args()
	
	print time.asctime(time.localtime())
	
	mandatory=['master_config']
	for m in mandatory:
		if not options.__dict__[m]:
			parser.print_help()
			sys.exit()
			
	#set up
	master_config=rm_misc.get_class_instance_from_python_path(options.master_config)
	prelim_network=TransportNetwork(master_config.network_config)
	
	#exclude links

	if 'exclude_group' in master_config.network_config: