Benutzer-Werkzeuge

Webseiten-Werkzeuge


Seitenleiste

ss15:projekte_im_sommersemester_15:dokumentation:main

main

Start des Programs

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
 
def main():
	from config import config
	from copy import copy
	import time
 
	variablen,GOTT=config()
 
	front=copy(GOTT.knotenliste)
	warteliste = copy(GOTT.warteliste)
	from iteration import iteration
	variablen.iterationszaehler=0
 
	if variablen.plot==True:
 
		import matplotlib.pyplot as plt
		import matplotlib
		import matplotlib.lines
		from matplotlib.lines import Line2D
		fig=plt.figure()
		ax=plt.subplot(111)
		fig.canvas.draw()
		ax.set_xlim((-variablen.rahmen[0],variablen.rahmen[0]))
		ax.set_ylim((-variablen.rahmen[1],variablen.rahmen[1]))
		for w in GOTT.wegliste:
			w.selfplot()
		c=len(GOTT.wegliste)
 
 
	i=0
	while (len(front)>0 or len(GOTT.warteliste)>0):
 
		i+=1
		front=iteration(front)
 
		if variablen.plot==True:
			d=len(GOTT.wegliste)
			for k in range(d-c+variablen.iterationszaehler):
				GOTT.wegliste[d-1-k].selfplot()
			c=d
			if i%variablen.plotabstand==0:	
				plt.pause(0.001)
				fig.canvas.blit(ax.bbox)
				fig.canvas.flush_events()
			variablen.iterationszaehler=0
 
 
 
	from jsontools import outputjson
	outputjson(GOTT.knotenliste,GOTT.wegliste)
 
	return GOTT.knotenliste, GOTT.wegliste
 
 
if __name__ == '__main__':
	main()

Als erstes wird config ausgeführt,

ss15/projekte_im_sommersemester_15/dokumentation/main.txt · Zuletzt geändert: 2016/05/10 14:46 (Externe Bearbeitung)