Exemple #1
0
    def __init__(self, sun, args):
        super().__init__()

        self.sun = sun
        self.tick = 0
        self.stop_tick = args.stop_tick
        if args.no_gui is True:
            self.tick_time = 0
        else:
            self.tick_time = 0.001

        # calculate start temp from sun
        self.avgTemp = args.temp[0]
        self.avgAlbedo = 0

        # init temp from given val
        self.worldTiles = [[Tile(self, args.temp[0], (x,y)) \
                            for x in range(self.SIZE_X)] \
                           for y in range(self.SIZE_Y)]
        self.worldLock = threading.Lock()

        self.initOptionsUI()
        DaisyFactory.setWorld(self)

        if args.iblack is not 0:
            self.enableInvasiveBlack.setChecked(True)
            self.invasiveBlackTemp.setValue(args.iblack)

        if args.iwhite is not 0:
            self.enableInvasiveWhite.setChecked(True)
            self.invasiveWhiteTemp.setValue(args.iwhite)

        self.threadRunning = True

        self.update()
Exemple #2
0
 def spawn(self):
     self.obj = DaisyFactory.createDaisy(self)