josauder / procedural_city_generation

Procedural City Generation program implemented in Python and Visualized with Blender.
Mozilla Public License 2.0
561 stars 86 forks source link

__Singleton instance has no attribute... #13

Open josauder opened 9 years ago

josauder commented 9 years ago

I'm getting an error during "Generate 3D Data" command -

__Singleton instance has no attribute 'floorheight_min'

_from buildinggeneration/Main.py, line 65 or so...

_floorheight=np.random.uniform(singleton.floorheight_min,singleton.floorheightmax)

I thought maybe the 'np' was the problem, but I removed it and still got an error.

The building configuration file looks fine:


building_generation.conf: {"roofheight_min": 0.03, "scalefactor_min_house": 0.4, "floorheight_min": 0.03, "prob_ledge": 0.5, "diffuse_iterations": 72, "windowheight_max_not_house": 0, "house_height": 0.15, "windowdist_max_not_house": 0.03, "diffuse_power": 1.8, "floorheight_max": 0.04, "scalefactor_max_not_house": 0.95, "windowheight_min": 0.015, "offset": 0.03, "ledgefactor_min": 1.01, "windowdist_min_house": 0.01, "windowwidth_min": 0.013, "scalefactor_max_house": 0.7, "scalefactor_min_not_house": 0.7, "ledgefactor_max": 1.05, "windowwidth_max": 0.025, "windowdist_min_not_house": 0, "windowdist_max_house": 0.03, "windowheight_max_house": 0.027, "roofheight_max": 0.07}

Command line I'm using to run:


python2.7 GUI.py

Ubuntu 14.04, all patches applied.

Full Traceback:


Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1489, in call return self.func(*args) File "GUI.py", line 65, in call main(["",self.modulename,"run"]) File "/home/joecamel/rst/download/Blender/proceduralcity_generation/UI.py", line 76, in main eval(args[1])() File "/home/joecamel/rst/download/Blender/procedural_city_generation/UI.py", line 21, in building_generation building_generation_main.main(polygons) File "/home/joecamel/rst/download/Blender/procedural_city_generation/procedural_city_generation/building_generation/main.py", line 65, in main floorheight=random.uniform(singleton.floorheight_min,singleton.floorheight_max) File "/home/joecamel/rst/download/Blender/procedural_city_generation/procedural_city_generation/additional_stuff/Singleton.py", line 37, in __getattr_ return getattr(self.instance,name) AttributeError: __Singleton instance has no attribute 'floorheight_min'

-"WhatISaidB4" at reddit

josauder: An instance of singleton is not killed when the program fails- perhaps I should move the kill call from the actual steps to the UI

HolySmokesBatman commented 9 years ago

Hello,

Upon further investigation, I found that commenting out the line:

    plt.show()

from polygons/main.py

fixed that particular problem. The image was being displayed properly in a separate window, but the program never seemed to return from that call correctly.