edceliz / GeneticAlgorithmUniversityClassScheduler

A class scheduler using adaptive-elitist genetic algorithm.
179 stars 81 forks source link

The app crashes whenever I try to generate the schedule #6

Open TheImperialOne opened 9 months ago

TheImperialOne commented 9 months ago

When I set all the things such as classrooms, instructors, subjects, and sections and try to generate the schedule, the application crashes, with the following exit code: Process finished with exit code -1073740791 (0xC0000409)` I have been running this project in Pycharm with Python 3.12.1

This problem occurs even with the simplest and most basic constraints, for example, I had assigned only 1 instructor to a single classroom with a single subject to a single section, but the app still crashes.

Below is the debug report: `import sys; print('Python %s on %s' % (sys.version, sys.platform)) D:\GAUCS\venv\Scripts\python.exe -X pycache_prefix=C:\Users\anike\AppData\Local\JetBrains\PyCharmCE2023.3\cpython-cache "D:/IDEs/PyCharm Community Edition 2023.3.3/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 54640 --file D:\GAUCS\main.py Connected to pydev debugger (build 233.13763.11) Traceback (most recent call last): File "D:\IDEs\PyCharm Community Edition 2023.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey_qt.py", line 237, in _new_run return self._original_run() ^^^^^^^^^^^^^^^^^^^^ File "D:\GAUCS\components\GeneticAlgorithm.py", line 759, in run self.initialization() File "D:\GAUCS\components\GeneticAlgorithm.py", line 51, in initialization self.generateChromosome(self.settings['minimum_population']) File "D:\GAUCS\components\GeneticAlgorithm.py", line 90, in generateChromosome self.generateSubjectPlacementsForSections(sections) File "D:\GAUCS\components\GeneticAlgorithm.py", line 112, in generateSubjectPlacementsForSections result = self.generateSubjectPlacement([section], subjectList[subjectToPlace]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\GAUCS\components\GeneticAlgorithm.py", line 150, in generateSubjectPlacement timeDetails = self.selectTimeDetails(subject, forceRandomMeeting) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\GAUCS\components\GeneticAlgorithm.py", line 202, in selectTimeDetails meetingPattern = np.random.choice(meetingPatterns) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "numpy\random\mtrand.pyx", line 937, in numpy.random.mtrand.RandomState.choice ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

Please help me with this issue

mjishnu commented 5 months ago

should be fixed by #7