In my model, I have been occasionally getting the following error from Windows:
(Swarm-1.3.1 running on Windows 95 in Virtual PC)
VOTINGMODEL caused a general protection fault
in module DIBENG.DLL at 0006:00001f06.
Registers:
EAX=0d0d0d0d CS=0377 EIP=00001f06 EFLGS=00000297
EBX=00000117 SS=0eaf ESP=00009a20 EBP=ffff0001
ECX=00000002 DS=11f6 ESI=00000230 FS=058f
EDX=40010001 ES=11f6 EDI=01a40030 GS=0eaf
Bytes at CS:EIP:
f3 aa 03 fe 66 4b 0f 8e 8b 00 00 00 66 8b cd 0b
Stack dump:
00009ade 00000002 00002ca1 037f0548 fb4a0210 fbce0000 00000000 00000000
00000000 81a9eef4 81ab2d68 81aae000 022f1c78 02308028 02300000 00030000
The backtrace reports no trace.
By sheer coincidence I was studying some of the output with a text printout. I noticed that in the runs where I was getting a general protection fault I was getting NaN as the values for one of the voters issue positions. The coalitions are formed by taking the weighted mean of their subordinates' issue positions, so the error is originating in the voter and creeping up to the coalition. Also odd to me is that the simulation can run for some time with this NaN value present before it gets the general protection fault.
Here is the code where the issue positions are created for the voter (again Coalitions just take the mean of their members).
-distributeIssuePositions { // Only for voters
int i;
for (i=0; i<numberOfIssues; i++)
{
idealPosition[i]=(double)[uniformInteger getIntegerWithMin: minPosition withMax: maxPosition];
issuePosition[i]=idealPosition[i];
}
// The uniform distribution will run from 0 to 100 for each of the issue dimensions.
// Can replace this with a normal distribution in later experiments
return self;
}
This is how I create the random numbers.
// Also some random number generators
aGenerator=[PMMLCG1 create: [self getZone] setStateFromSeed: randomSeed];
uniformDouble=[UniformDouble create: [self getZone] setGenerator: aGenerator];
uniformInteger=[UniformInteger create: [self getZone] setGenerator: aGenerator];
_____________________________________________
Darren Schreiber
Attorney at Law
Graduate Student
Political Science, UCLA
address@hidden