davidrmiller / biosim4

Biological evolution simulator
Other
3.2k stars 459 forks source link

Getting a segmentation fault #14

Open omidnezami123 opened 2 years ago

omidnezami123 commented 2 years ago

Hey,

Just spent most of my day getting this set up on Windows. I've got it compiling however, but when I try to run the executable, I'm getting a segmentation fault.

The only thing I've changed is the biosim4.ini, so here's how that looks like:

numThreads = 10

sizeX = 128
sizeY = 128

population = 1000

stepsPerGeneration = 300

maxGenerations = 10

genomeInitialLengthMin = 20
genomeInitialLengthMax = 20
genomeMaxLength = 300

maxNumberNeurons = 3

killEnable = false

sexualReproduction = true

chooseParentsByFitness = true

pointMutationRate = 0.001

geneInsertionDeletionRate = 0.0
deletionRatio = 0.5

responsivenessCurveKFactor = 2

populationSensorRadius = 2.5

longProbeDistance = 24

shortProbeBarrierDistance = 4

signalSensorRadius = 2.0

signalLayers = 1

imageDir = images

logDir = logs

displayScale = 8

agentSize = 4

videoSaveFirstFrames = 2

updateGraphLog = true

saveVideo = true

videoStride = 25

updateGraphLogStride = videoStride

genomeAnalysisStride = videoStride

genomeComparisonMethod = 1

displaySampleGenomes = 10

challenge = 17

barrierType = 0

replaceBarrierType = 0
replaceBarrierTypeGenerationNumber = -1

Here's the last part of the output from the terminal as well:

Gen 9, 266 survivors
---------------------------
Individual ID 1
effa52e0 6d003ea5 d8c016e5 be088ac0 1cdeaea8 518250dc 1932306a 44eeee4e
4d5a0762 385d169c da55a7ac b51e412f 11066f79 0a2c4f98 6ad098ab 0bc67bfa
db7d66c9 d90cd171 69968660 2840a9be

N1 N2 -4102
Sfd N1 27904
LPb N2 -10048
N0 N0 -16888
N0 N0 7390
N2 N1 20866
N2 N0 6450
N0 N2 17646
N0 N2 14429
Ly N1 27344
Blr N0 -9347
N0 N1 27030
N1 MRL 19802
N2 MRL -9643
EDx MvX -19170
Sg Res 4358
N1 Res 2604
N2 MvL 3014
Age SG -9972
N2 Mrn 10304
---------------------------
---------------------------
Individual ID 2
f9b6055a ad8f7a13 f17617d5 f2213c97 33fb9cc3 1f1e7dbd f17e3a08 97dece03
65fb4c48 235759ab 0e59ba5b c91cb7eb 42553b97 a782768e fae2f3ad c366166b
a58421d1 2529dc1a 0bac2384 22ec565a

Plr N0 -3551
Osc N0 13307
ED N0 3673
N0 Mfd -1610
Ly MvN -3722
Pop MvR 7966
Ly MvS 9047
Plr MvN -14052
Plr MvL 16981
EDx MvE -1310
Slr MvX -23164
N0 MvY 2988
---------------------------
---------------------------
Individual ID 3
4885dbf4 de441096 2e7b285e b8728c3f 26fe379d 1f1e7dbd f17e3a08 9c945ed3
3bff3ef7 89cf29c9 ca1758a1 85f14b7c 997e8665 54083818 6ad098ab 0bc67bfa
db7d66c9 52dfac37 dd64fe22 af4775a3

N0 N2 -8636
N2 N2 11899
Pop N1 -18318
N1 N2 -3714
Lx N2 -25452
Sg N1 15359
Rnd N2 -13801
LPf N1 -26242
N0 N1 21512
Ly N1 27344
Blr N0 -9347
LMx N2 21215
N2 N1 -8860
N2 MvL 18565
Bfd MvN 9982
Pop MvR 7966
Blr Mrn -30257
N2 OSC -31247
N2 MvL 3014
Sg MvW -20665
---------------------------
Sensors in use:
  862 - loc X
  721 - loc Y
  805 - boundary dist X
  355 - boundary dist
  545 - boundary dist Y
  332 - genetic similarity fwd
  170 - last move dir X
  303 - last move dir Y
  492 - long probe population fwd
  573 - long probe barrier fwd
  651 - population
  388 - population fwd
  709 - population LR
  387 - osc1
  367 - age
  465 - short probe barrier fwd-rev
  521 - short probe barrier left-right
  204 - random
  604 - signal 0
  544 - signal 0 fwd
  418 - signal 0 LR
Actions in use:
  391 - move X
  670 - move Y
  600 - move fwd
  684 - move R-L
  637 - move random
  576 - set osc1
  697 - set longprobe dist
  532 - set inv-responsiveness
  482 - emit signal 0
  739 - move east
  667 - move west
  420 - move north
  966 - move south
  647 - move left
  789 - move right
  520 - move reverse
Simulator waiting...
Simulator exit.
Segmentation fault

Would really appreciate some help with this.

Also, want to thank David for posting this video. Easily one of my favorites on the platform today.

I'm a CS guy, but I found the intersectionality with biology fascinating. The complexity of a brain with only a couple of neurons leaves me in awe of how complicated our brains must be.

geoffarnold commented 2 years ago

By "Windows", do you mean "Windows 11 using WSL"? I've had this combo running without any problems. (And without any changes to source code or configuration.)

I would personally be skeptical of trying to modify this project to create a Windows native version, because it depends on quite a few Linux libraries and I would expect that the main stream of development will apply to the Linux version (native, WSL, VM, Dockerized, whatever). It would be, er, "challenging" to keep the Windows native fork up to date. And with WSL the project is easily accessible to Windows users.

omidnezami123 commented 2 years ago

I'm using Windows 10 with WSL. Yeah, I realized after cloning it locally that the Windows native version had some issues, so I recloned the project in WSL (Ubuntu v21.04).

Thanks for the input though.

mathematicalmichael commented 2 years ago

might I suggest trying docker (#8)? I've published images that can compile + execute and have tested them on everything except WSL / Windows, but would love feedback on whether or not it changes anything about your segfault error.