def initialize():
	print 'Initializing...'
	Sim.initialize()
	
	print 'Random seed: ' + repr(params['random seed'])
	random.seed(params['random seed'])
	
	pop0 = LinePopulation( 500.0, 500.0, params['initial x std dev'], params['initial y std dev'], 
							params['mean speak'], params['mean learn'], params['mean innovation'],
							500.0, params['pop0 loc sd'], params['mean talk radius'] )
	
	for i in range(params['num agents']):
		pop0.new_agent()
	
	segregator = Segregator()
	Sim.activate( segregator, segregator.go() )
def main():
	print 'Initializing...'
	Sim.initialize()
		
	white = LinePopulation( params['white x mean'], params['white y mean'],
				params['white x std dev'], params['white y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['white mean loc'], 
				params['white loc sd'], params['white talk radius'], 'white' )
	
	seasoned = LinePopulation( params['seasoned x mean'], params['seasoned y mean'],
				params['seasoned x std dev'], params['seasoned y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['seasoned mean loc'], 
				params['seasoned loc sd'], params['seasoned talk radius'], 'seasoned' )
	
	bozal0 = LinePopulation( params['bozal0 x mean'], params['bozal0 y mean'],
				params['bozal0 x std dev'], params['bozal0 y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['bozal mean loc'], 
				params['bozal loc sd'], params['bozal talk radius'], 'bozal 0')
	
	bozal1 = LinePopulation( params['bozal1 x mean'], params['bozal1 y mean'],
				params['bozal1 x std dev'], params['bozal1 y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['bozal mean loc'], 
				params['bozal loc sd'], params['bozal talk radius'], 'bozal 1' )
	
	for i in range(params['num white']):
		white.new_agent()	
	for i in range(params['num seasoned']):
		seasoned.new_agent()
	for i in range(params['num bozal']):
		if i%2 == 0:
			bozal0.new_agent()
		else:
			bozal1.new_agent()
	
	plotter = Plotter('centripetal', params['plot period'], params['stop time'], params)
	Sim.activate( plotter, plotter.go() )
	
	print 'Simulating...'
	Sim.simulate(until=params['stop time'])
	print 'Simulation Complete at t=%s' % Sim.now()
	
	plotter.cleanup()
def main():
	print 'Initializing...'
	Sim.initialize()
		
	white = LinePopulation( params['white x mean'], params['white y mean'],
				params['white x std dev'], params['white y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['white mean loc'], 
				params['white loc sd'], params['white talk radius'], 'white' )
	
	seasoned = LinePopulation( 0.0, 0.0, 0.0, 0.0, params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['seasoned mean loc'], 
				params['seasoned loc sd'], params['seasoned talk radius'], 'seasoned' )
	
	bozal0 = LinePopulation( params['bozal0 x mean'], params['bozal0 y mean'],
				params['bozal0 x std dev'], params['bozal0 y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['bozal mean loc'], 
				params['bozal loc sd'], params['bozal talk radius'], 'bozal 0')
	
	bozal1 = LinePopulation( params['bozal1 x mean'], params['bozal1 y mean'],
				params['bozal1 x std dev'], params['bozal1 y std dev'], params['mean speak'], 
				params['mean learn'], params['mean innovation'], params['bozal mean loc'], 
				params['bozal loc sd'], params['bozal talk radius'], 'bozal 1' )
	
	for i in range(params['num white']):
		white.new_agent()
	for i in range(params['num slaves']):
		if i%2 == 0:
			bozal0.new_agent()
		else:
			bozal1.new_agent()
	
	adjuster = PopAdjuster( white, seasoned, bozal0, bozal1, params['update period'],
					params['pop schedule'], params['white pop targets'],
					params['slave pop targets'], params['proportion seasoned'] )
	Sim.activate( adjuster, adjuster.go() )
	
	number = math.ceil(params['proportion seasoned']*white.num_agents())
	adjuster.get_seasoned( number, white, bozal0, bozal1, seasoned )
	
	plotter = Plotter('gradual', params['plot period'], params['stop time'], params)
	Sim.activate( plotter, plotter.go() )
	
	print 'Simulating...'
	Sim.simulate(until=params['stop time'])
	print 'Simulation Complete at t=%s' % Sim.now()
	
	plotter.cleanup()