Appendix C. PEI Test Case Setup

The PEI test case setup domain function is listed here in it entirety.

PEI Test Case Initialization Function Listing

Figure C.1. PEI Model Init Function

//
// Set up instances for existance test later on.
//
create object instance a of A;  // extras to see in PEIs
create object instance a of A;
create object instance a of A; a.i = 1;
create object instance b of B; b.i = 2;
relate a to b across R1;
create object instance a of A; a.i = 3;
create object instance b of B; b.i = 4;
relate b to a across R1;
create object instance a of A; a.i = 5;
create object instance b of B; b.i = 6;
relate a to b across R1;
create object instance b of B;  // extra to see it in PEIs

create object instance c1 of C; c1.cID = 1;
create object instance c2 of C; c2.cID = 2;
create object instance c3 of C; c3.cID = 3;
create object instance c4 of C; c4.cID = 4;
create object instance c5 of C;  // extra
create object instance d1 of D;  // extra
create object instance d2 of D; d2.name = "DeeTwo";
relate c1 to d2 across R2;
relate d2 to c2 across R2;
relate d2 to c3 across R2;
relate c4 to d2 across R2;

create object instance e1 of E; e1.eID = 1; e1.ratio = 0.314;
create object instance e0 of E; e1.eID = 100; e1.ratio = 0.1;
create object instance e2 of E; e2.eID = 2; e2.ratio = 2.718;
create object instance f3 of F; f3.fID = 3; f3.enabled = true;
create object instance f2 of F; f2.fID = 2; f2.enabled = false;
create object instance f1 of F; f1.fID = 1; f1.enabled = true;
create object instance g1 of G; g1.gID = 1;
create object instance g2 of G; g2.gID = 2;
create object instance g3 of G; g3.gID = 3;
create object instance g4 of G; g4.gID = 4;
relate e1 to f1 across R3 using g1;
relate f2 to e1 across R3 using g2;
relate f3 to e2 across R3 using g3;
relate e1 to f3 across R3 using g4;

create object instance h1 of H; h1.hID = 1;
create object instance h2 of H; h2.hID = 2;
create object instance h of H; h.hID = 99;  // extra to see in PEIs
create object instance h3 of H; h3.hID = 3;
create object instance h4 of H; h4.hID = 4;
relate h1 to h2 across R4.'precedes';
relate h2 to h3 across R4.'precedes';
relate h4 to h3 across R4.'follows';

create object instance i4 of I; i4.iID = 400; i4.common = 400;
create object instance i3 of I; i3.iID = 300; i3.common = 300;
create object instance i2 of I; i2.iID = 200; i2.common = 200;
create object instance i1 of I; i1.iID = 100; i1.common = 100;
create object instance j1 of J; j1.jID = 2; j1.specialJ = 2;
create object instance k1 of K; k1.kID = 11; k1.specialcommon = 11;
create object instance k2 of K; k2.kID = 22; k2.specialcommon = 22;
create object instance k3 of K; k3.kID = 33; k3.specialcommon = 33;
create object instance l2 of L; l2.lID = 222; l2.specialL = 222;
create object instance l3 of L; l3.lID = 333; l3.specialL = 333;
create object instance l1 of L; l1.lID = 111; l1.specialL = 111;
relate i1 to j1 across R5;
relate i2 to k3 across R5;
relate k2 to i3 across R5;
relate i4 to k1 across R5;
relate l1 to k1 across R6;
relate l3 to k2 across R6;
relate k3 to l2 across R6;

create object instance o1 of O; o1.oID = 1; o1.voo = "Kenny";
create object instance o2 of O; o2.oID = 2; o2.voo = "Cort";
create object instance o3 of O; o3.oID = 3; o3.voo = "Amy";
create object instance o4 of O; o4.oID = 4; o4.voo = "Ellen";
create object instance o5 of O; o5.oID = 5; o5.voo = "Brad";
relate o1 to o2 across R8.'teaches'; // Kenny teaches Cort.
relate o2 to o3 across R8.'teaches'; // Cort teaches Amy.
relate o4 to o2 across R8.'learns from'; // Ellen learns from Cort.
relate o5 to o2 across R8.'learns from'; // Brad learns from Cort.

create object instance n1 of N; n1.nID = 1; n1.name = "Pete";
create object instance n2 of N; n2.nID = 2; n2.name = "Dave";
create object instance n3 of N; n3.nID = 3; n3.name = "Alex";
create object instance n4 of N; n4.nID = 4; n4.name = "Jenn";
create object instance n5 of N; n5.nID = 5; n5.name = "Cale";
create object instance n6 of N; n6.nID = 6; n6.name = "Chris";
create object instance m1 of M; m1.mID = 1; m1.department = "SW";
create object instance m2 of M; m2.mID = 2; m2.department = "SW";
create object instance m3 of M; m3.mID = 3; m3.department = "HW";
create object instance m4 of M; m4.mID = 4; m4.department = "MEC";
create object instance m5 of M; m5.mID = 5; m5.department = "MEC";
relate n1 to n3 across R7.'manages' using m1;   // Pete manages Alex.
relate n1 to n4 across R7.'manages' using m2;   // Pete manages Jenn.
relate n5 to n2 across R7.'works for' using m3; // Cale works for Dave.
relate n1 to n6 across R7.'works for' using m4; // Pete works for Chris.
relate n6 to n2 across R7.'manages' using m5; // Chris manages Dave.

create object instance p1 of P; p1.eyedee = "Rox";
create object instance p2 of P; p2.eyedee = "Bita";
create object instance p3 of P; p3.eyedee = "Tina";
create object instance q1 of Q; q1.deeeye = "Shane";
create object instance q2 of Q; q2.deeeye = "Rusty";
create object instance q3 of Q; q3.deeeye = "Cort";
create object instance r1 of R; r1.city = "Indianapolis";
create object instance r2 of R; r2.city = "Lockport";
create object instance r3 of R; r3.city = "Battleground";
relate p1 to q3 across R9 using r1;
relate q2 to p2 across R9 using r3;
relate p3 to q1 across R9 using r2;

create object instance s1 of S; s1.s = "Rox";
create object instance s2 of S; s2.s = "Jacqui";
create object instance t1 of T; t1.t = "Clare";
create object instance t2 of T; t2.t = "Katrina";
create object instance t3 of T; t3.t = "Colleen";
create object instance t4 of T; t4.t = "Hannah";
create object instance t5 of T; t5.t = "Ruby";
create object instance u5 of U; u5.s = "Oct";
create object instance u4 of U; u4.s = "Aug";
create object instance u3 of U; u3.s = "Apr";
create object instance u2 of U; u2.s = "Dec";
create object instance u1 of U; u1.s = "Nov";
relate s1 to t4 across R10 using u2;
relate s1 to t5 across R10 using u1;
relate t1 to s2 across R10 using u5;
relate t2 to s2 across R10 using u4;
relate s2 to t3 across R10 using u3;

create object instance w1 of W; w1.name = "Cort";
create object instance w2 of W; w2.name = "Rox";
create object instance w3 of W; w3.name = "Sean";
create object instance w4 of W; w4.name = "Jacqui";
create object instance v1 of V; v1.year = 1988;
create object instance v2 of V; v2.year = 1990;
relate w1 to w2 across R11.'is husband of' using v1;
relate w4 to w3 across R11.'is wife of' using v2;

// friends and friendships
create object instance x1 of X; x1.name = "Cort"; x1.age = 39;
create object instance x2 of X; x2.name = "Rox"; x2.age = 38;
create object instance x3 of X; x3.name = "Sevina"; x3.age = 35;
create object instance x4 of X; x4.name = "Joe"; x4.age = 43;
create object instance x5 of X; x5.name = "Scott"; x5.age = 42;
create object instance x6 of X; x6.name = "Jason"; x6.age = 31;
create object instance y1 of Y; y1.duration = 1; y1.closeness = 10;
create object instance y2 of Y; y2.duration = 2; y2.closeness = 20;
create object instance y3 of Y; y3.duration = 3; y3.closeness = 30;
create object instance y4 of Y; y4.duration = 4; y4.closeness = 40;
create object instance y5 of Y; y5.duration = 5; y5.closeness = 50;
create object instance y6 of Y; y6.duration = 6; y6.closeness = 60;
create object instance y7 of Y; y7.duration = 7; y7.closeness = 70;
create object instance y8 of Y; y8.duration = 8; y8.closeness = 80;
create object instance y9 of Y; y9.duration = 9; y9.closeness = 90;
// Cort's friends
relate x1 to x2 across R12.'is buddy of' using y1;
relate x1 to x3 across R12.'is pal of' using y2;
relate x4 to x1 across R12.'is buddy of' using y3;
relate x5 to x1 across R12.'is pal of' using y4;
relate x1 to x6 across R12.'is buddy of' using y5;
// Rox's friends
relate x3 to x2 across R12.'is pal of' using y6;
// Joe's friends
relate x4 to x5 across R12.'is buddy of' using y7;
relate x4 to x6 across R12.'is pal of' using y8;
// Scott's friends
relate x6 to x5 across R12.'is buddy of' using y9;


// dealers and deals
create object instance z1 of Z; z1.name = "Joe"; z1.worth = 1;
create object instance z2 of Z; z2.name = "Pat"; z2.worth = 2;
create object instance z3 of Z; z3.name = "Jason"; z3.worth = 3;
create object instance zz1 of ZZ; zz1.xaction = 1; zz1.value = -1;
create object instance zz2 of ZZ; zz2.xaction = 2; zz2.value = 2;
create object instance zz3 of ZZ; zz3.xaction = 3; zz3.value = -3;
create object instance zz4 of ZZ; zz4.xaction = 4; zz4.value = 4;
create object instance zz5 of ZZ; zz5.xaction = 5; zz5.value = -5;
create object instance zz6 of ZZ; zz6.xaction = 6; zz6.value = 6;
create object instance zz7 of ZZ; zz7.xaction = 7; zz7.value = -7;
relate z1 to z2 across R13.'sells to' using zz1;
relate z1 to z3 across R13.'buys from' using zz2;
relate z2 to z3 across R13.'sells to' using zz3;
relate z3 to z1 across R13.'buys from' using zz4;
relate z2 to z1 across R13.'sells to' using zz5;
relate z2 to z3 across R13.'buys from' using zz6;
relate z1 to z2 across R13.'sells to' using zz7;