# Path: route_model/choice_set/beta_unif_randomizer.py
# class BetaUnifRandomizer(LinkRandomizer):
# 	
# 	def __init__(self,G,variables,no_randomize,b,s,scl):			
# 			
# 		LinkRandomizer.__init__(self)
# 		
# 		self['variables']=variables
# 		self['no_randomize']=no_randomize
# 
# 		self.set_scl(scl)
# 		self.set_fam(nr.beta,nr.uniform)
# 		self.set_par([1,b],[1-s,1+s])
# 		
# 		self.get_link_distribution(G)
# 		
# 		self.get_fam_means()
# 		self.update_denoms()
# 		
# 	def get_fam_means(self):
# 		
# 		self['zero']['mean']=self['zero']['par'][0]/(self['zero']['par'][0]+self['zero']['par'][1])
# 		self['pos']['mean']=(self['pos']['par'][0]+self['pos']['par'][1])/2


import os, time, string
import random
import route_model.misc as rm_misc
from UserDict import UserDict
from math import sqrt, exp
from numpy import *
from route_model.choice_set.beta_unif_randomizer import BetaUnifRandomizer
						'DISTANCE',
						'DISTANCE',
						None]
		self['trace_funs']=['sum',
						'avg',
						'avg',
						'avg',
						'avg',
						'avg',
						'sum']
		self['final_funs']=[None,None,None,None,None,None,None]
		self['path_size']=True
		self['path_size_log']=True
		self['path_size_alias']='lnpathsize'
		self['divisors']={'TURNS_P_MI':'DISTANCE'}	# calculate this alias by dividing by this variable
		
		"""fixed coefficients"""
		self['fixed_coefficients']=['DISTANCE','TURNS_P_MI','WRONG_WAY','BIKE_PCT_1','BIKE_PCT_2','BIKE_PCT_3','AVG_RISE','lnpathsize']
		self['alpha']=[-1.05,-0.21,-13.30,1.89,2.15,0.35,-154.0,1.0]
		
		"""random coefficients"""
		self['use_random_coefficients']=False
		self['random_coefficients']=[]#['BIKE_PCT_1','BIKE_PCT_2','BIKE_PCT_3','AVG_RISE']
		self['random_transformations']=[]#[idenfun,idenfun,idenfun,idenfun]
		self['latent_mu']=[]#[1.82,2.49,0.76,-2.22]
		self['latent_sigma']=array([])
		"""array( [	[24.95,	0.,	6.58,	0.	],
								[0.,		5.45,	2.91,	0.	],
								[0.,		0.,	4.19,	0.	],
								[0.,		0.,	0.,	3.85	]	] )"""

# Path: route_model/choice_set/beta_unif_randomizer.py
# class BetaUnifRandomizer(LinkRandomizer):
# 	
# 	def __init__(self,G,variables,no_randomize,b,s,scl):			
# 			
# 		LinkRandomizer.__init__(self)
# 		
# 		self['variables']=variables
# 		self['no_randomize']=no_randomize
# 
# 		self.set_scl(scl)
# 		self.set_fam(nr.beta,nr.uniform)
# 		self.set_par([1,b],[1-s,1+s])
# 		
# 		self.get_link_distribution(G)
# 		
# 		self.get_fam_means()
# 		self.update_denoms()
# 		
# 	def get_fam_means(self):
# 		
# 		self['zero']['mean']=self['zero']['par'][0]/(self['zero']['par'][0]+self['zero']['par'][1])
# 		self['pos']['mean']=(self['pos']['par'][0]+self['pos']['par'][1])/2


# Path: route_model/config/master_config_for_integrated_run.py
import os, time, string
import random
import route_model.misc as rm_misc
from UserDict import UserDict
from math import sqrt, exp
from numpy import *
from route_model.choice_set.beta_unif_randomizer import BetaUnifRandomizer

						'DISTANCE',
						'DISTANCE',
						None]
		self['trace_funs']=['sum',
						'avg',
						'avg',
						'avg',
						'avg',
						'avg',
						'sum']
		self['final_funs']=[None,None,None,None,None,None,None]
		self['path_size']=True
		self['path_size_log']=True
		self['path_size_alias']='lnpathsize'
		self['divisors']={'TURNS_P_MI':'DISTANCE'}	# calculate this alias by dividing by this variable
		
		"""fixed coefficients"""
		self['fixed_coefficients']=['DISTANCE','TURNS_P_MI','WRONG_WAY','BIKE_PCT_1','BIKE_PCT_2','BIKE_PCT_3','AVG_RISE','lnpathsize']
		self['alpha']=[-1.05,-0.21,-13.30,1.89,2.15,0.35,-154.0,1.0]
		
		"""random coefficients"""
		self['use_random_coefficients']=False
		self['random_coefficients']=[]#['BIKE_PCT_1','BIKE_PCT_2','BIKE_PCT_3','AVG_RISE']
		self['random_transformations']=[]#[idenfun,idenfun,idenfun,idenfun]
		self['latent_mu']=[]#[1.82,2.49,0.76,-2.22]
		self['latent_sigma']=array([])
		"""array( [	[24.95,	0.,	6.58,	0.	],
								[0.,		5.45,	2.91,	0.	],
								[0.,		0.,	4.19,	0.	],
								[0.,		0.,	0.,	3.85	]	] )"""

		self['mixing_granularity']=0.2 # number of trips to simulate as an individual