jes icon indicating copy to clipboard operation
jes copied to clipboard

Unable to Use Odd Creature Counts

Open SpikeyLP opened this issue 11 months ago • 1 comments

Body: When attempting to configure the system with an odd number of creatures, the application returns an error or behaves unexpectedly. This seems to be due to a restriction that enforces even creature counts.

Steps to Reproduce:

  1. Set up the environment as per the documentation.
    
  2. Input an odd number for the creature count.
    
  3. Generate a set by pressing "Do a generation" or by turning on ALAP.
    
  4. Observe the error or unexpected behavior.
    

Expected Behavior: The system should either handle odd creature counts gracefully or clearly indicate why only even counts are supported.

Actual Behavior: An error is thrown, and the application halts.

Environment:

Version: # Updates (2025-01-11) OS: Win 11 Other details: See error code below Request: Please investigate whether supporting odd creature counts is feasible or if documentation should clarify this restriction.

Exception:

Exception has occurred: AttributeError
'NoneType' object has no attribute 'dna'
  File "jes_sim.py", line 99, in getMuscleArray
    dna = self.creatures[gen][c].dna[0:DNA_LEN].reshape(self.CH, self.CW, self.beats_per_cycle, self.traits_per_box)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "jes_sim.py", line 106, in simulateImport
    muscles = self.getMuscleArray(gen, startIndex, endIndex)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "jes_sim.py", line 74, in getCalmStates
    param = self.simulateImport(gen, startIndex, endIndex, False)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "jes_sim.py", line 223, in doGeneration
    self.getCalmStates(gen + 1, 0, self.c_count, self.stabilization_time, True)
  File "jes_button.py", line 29, in click
    self.func(self)
  File "jes_ui.py", line 398, in detectEvents
    button.click()
  File "jes.py", line 36, in <module>
    ui.detectEvents()
AttributeError: 'NoneType' object has no attribute 'dna'

SpikeyLP avatar Jan 16 '25 13:01 SpikeyLP

First off, the input only gives you three options for a creature count. 100, 250, and 500. All of which are even. Secondly, let's imagine what would happen if you had an odd number of creatures. We'll go with 501. So we have these 501 creatures, and they do a run. 251 survive, 250 don't see the light of day. Every creature reproduces, and f*ck. Now we have 502 creatures. 2 workarounds come to mind. The first is have 251 survive and then have 1 wild card that doesn't reproduce. Option 2 is 251 survive, and the best performer reproduce 2 offspring. Both ideas, especially the former, feel too much like making a random exception to satisfy something that has an alternative that throws a thought of needing either of these. At least for me.

Carykeyhole avatar Oct 28 '25 20:10 Carykeyhole