From 328129cac34a4b25907f25b1a77198b45262903e Mon Sep 17 00:00:00 2001 From: Holger Ingmar Meinhardt Date: Sun, 26 Apr 2020 11:33:43 +0200 Subject: [PATCH] V2.6.0 --- ChangeLog | 5 + ChangeLog.md | 7 + IOTuGamesV6.nb | 162 +- IOTuGamesV6.m => IOTuGamesV6.wl | 26 +- Kernel/init.m | 14 +- MATtug.m => MATtug.wl | 2 + PacletInfo.m | 4 +- ParaTuGames.nb | 588 +++-- ParaTuGames.m => ParaTuGames.wl | 19 +- README | 65 +- README.md | 74 +- TuGames.nb | 3708 +++++++++++++++++++++---------- TuGames.m => TuGames.wl | 915 +++++--- TuGamesAux.nb | 278 ++- TuGamesAux.m => TuGamesAux.wl | 37 +- 15 files changed, 3750 insertions(+), 2154 deletions(-) rename IOTuGamesV6.m => IOTuGamesV6.wl (98%) rename MATtug.m => MATtug.wl (99%) rename ParaTuGames.m => ParaTuGames.wl (98%) rename TuGames.m => TuGames.wl (88%) rename TuGamesAux.m => TuGamesAux.wl (97%) diff --git a/ChangeLog b/ChangeLog index 8b48804..a6f1097 100644 --- a/ChangeLog +++ b/ChangeLog @@ -217,3 +217,8 @@ for n=6 we have to check 158 classes. + Version 2.6.0: + Adding functions to compute the EPSD-Value, Chi-Value, PD-Value and the nucleolus by the Leng and Parlar (2010) formulae for three person + zero-normalized and super-additive games. Changing the package extension from *.m to *.wl. + + Performing some code maintenance and minor bug fixes. diff --git a/ChangeLog.md b/ChangeLog.md index 55303af..db9bdce 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -219,3 +219,10 @@ satisfies a balanced inequality of a TU-game. Notice that if all balanced systems satisfying this property non-emptiness of the core is guaranteed. Recall that for n=4 we need to check 9 equivalence classes, however, for n=6 we have to check 158 classes. + + +### Version 2.6.0: + Adding functions to compute the EPSD-Value, Chi-Value, PD-Value and the nucleolus by the Leng and Parlar (2010) formulae for three person + zero-normalized and super-additive games. Changing the package extension from *.m to *.wl. + + Performing some code maintenance and minor bug fixes. diff --git a/IOTuGamesV6.nb b/IOTuGamesV6.nb index 195c609..b1ad4f8 100644 --- a/IOTuGamesV6.nb +++ b/IOTuGamesV6.nb @@ -3,17 +3,17 @@ (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) -(* CreatedBy='Mathematica 11.3' *) +(* CreatedBy='Mathematica 12.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] -NotebookDataLength[ 159777, 3786] -NotebookOptionsPosition[ 157453, 3752] -NotebookOutlinePosition[ 157788, 3767] -CellTagsIndexPosition[ 157745, 3764] +NotebookDataLength[ 159646, 3780] +NotebookOptionsPosition[ 157265, 3745] +NotebookOutlinePosition[ 157657, 3761] +CellTagsIndexPosition[ 157614, 3758] WindowFrame->Normal*) (* Beginning of Notebook Content *) @@ -25,9 +25,9 @@ Cell[BoxData[ RowBox[{"IOTuGamesV6", ".", RowBox[{"m", "\n", " ", ":", " ", RowBox[{"Release", " ", "Date"}], " ", ":", " ", - RowBox[{"20.01", ".2019"}], "\n", " ", ":", " ", - RowBox[{"Version", " ", "2.5"}]}]}]}], " ", "\n", "\n", "*)"}], "\n", - "\n", + RowBox[{"22.04", ".2020"}], "\n", " ", ":", " ", + RowBox[{"Version", " ", "2.6", ".0"}]}]}]}], " ", "\n", "\n", "*)"}], + "\n", "\n", RowBox[{"(*", " ", RowBox[{":", "Context", ":", " ", "IOTuGamesV6`"}], " ", "*)"}], "\n", "\n", @@ -122,8 +122,9 @@ therefore adjusted by setting PtRadius. Similar for the line segment of a\n \ two-dimensional Kernel, this is set to 0.75*PtRadius. In \ addition, the modiclus\n can be drawn by invoking the \ options ViewModiclusSol -> True. Finally, a bug\n w.r.t. \ -the option UseManipulate -> True has been fixed. \n \>"}]}]}]}]}], - "*)"}]}]], "Code",ExpressionUUID->"5f1a0273-539d-4071-bb69-7aa2fcebc15e"], +the option UseManipulate -> True has been fixed.\n Version 2.6.0:\n \ + Performing some code maintenance. \n \>"}]}]}]}]}], + "*)"}]}]], "Code",ExpressionUUID->"1d02bdcf-d6f7-4ad0-aba0-8d490ebd57ac"], Cell[BoxData[ RowBox[{ @@ -150,7 +151,7 @@ Cell[BoxData[ RowBox[{ "8.", " ", "\n", " ", "Four", " ", "Person", " ", "Games", " ", RowBox[{"only", "!"}]}]}]}], "\n", "*)"}], "\n", "\n"}]], "Code",Express\ -ionUUID->"b7b89c2f-5b14-4d43-b4de-f38de49ec215"], +ionUUID->"8845b317-8fb2-42e2-88f6-3a982cd415c5"], Cell[BoxData[{ RowBox[{ @@ -238,7 +239,7 @@ NucleolusCoord.\>\""}], ";"}], "\n"}], "\n", RowBox[{"PictureSize", "::", "usage"}], " ", "=", "\n", "\"\\""}], ";"}]}], "Code",Expre\ -ssionUUID->"a768d61e-ef3d-4474-94dd-370c691f5e77"], +ssionUUID->"491176fb-6bd1-46e4-9139-5b3eb1ae1446"], Cell[BoxData[ RowBox[{ @@ -685,8 +686,8 @@ Cell[BoxData[ "]"}]}]}], "\n", " ", "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "\n", "]"}]}], - ";"}], "\n"}]}]], "Code",ExpressionUUID->"6f5cbcb1-b3bd-442c-a131-\ -a94632b464e3"], + ";"}], "\n"}]}]], "Code",ExpressionUUID->"b8bc213d-0aee-48a9-b856-\ +90ee7bbb042d"], Cell[BoxData[{ RowBox[{ @@ -1137,7 +1138,7 @@ Cell[BoxData[{ RowBox[{"vert", ",", " ", "vskl"}], "]"}]}], "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"df9e75c8-f345-496a-b30d-e344c381373a"], + ";"}]}], "Code",ExpressionUUID->"8de4d22f-4aae-4d40-81aa-7a55732f513e"], Cell[BoxData[{ RowBox[{ @@ -1637,8 +1638,8 @@ Cell[BoxData[{ RowBox[{"N", "[", "epsval", "]"}], "]"}]}], "]"}]}]}], "]"}]}], ";", " ", "\n", " ", RowBox[{"Return", "[", "gr3", "]"}], ";"}]}], "\n", " ", "\n", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"9a45f789-b6db-47cf-a7f3-\ -c4473175b9d7"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"7147c352-20c1-482a-8396-\ +f717dcef3025"], Cell[BoxData[ RowBox[{ @@ -1694,7 +1695,7 @@ Cell[BoxData[ RowBox[{"Max", "[", RowBox[{"epsval", ",", "1"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "epsval", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"5d6136d4-8ce8-4c41-a526-0ca3d468b66f"], + ";"}]], "Code",ExpressionUUID->"b0aed142-14aa-4147-afe7-78f6e72f79aa"], Cell[BoxData[{ RowBox[{ @@ -2063,8 +2064,8 @@ Cell[BoxData[{ RowBox[{"{", RowBox[{"v3", ",", " ", "1.54", ",", "\"\\""}], "}"}], ",", " ", "4"}], "}"}]}], "]"}]}], "]"}]}]}], " ", "\n", - " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"f75ba8a0-95f9-4cbf-9cfb-\ -243360848c72"], + " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"96dfe838-3d72-4caa-b383-\ +40eb7ccf73b7"], Cell[BoxData[ RowBox[{ @@ -2129,14 +2130,12 @@ Cell[BoxData[ RowBox[{"Which", "[", RowBox[{ RowBox[{"d1", " ", "===", " ", "1"}], ",", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "kersol"}], "]"}], ",", "\n", + RowBox[{"Total", "[", "kersol", "]"}], ",", "\n", " ", RowBox[{"d1", " ", "===", " ", "2"}], ",", " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "#"}], "]"}], "&"}], "/@", "kersol"}], ",", + RowBox[{"Total", "[", "#", "]"}], "&"}], "/@", "kersol"}], ",", "\n", " ", "True", ",", "1"}], "]"}]}], ";", "\n", " ", RowBox[{"kercoord", " ", "=", " ", @@ -2194,7 +2193,7 @@ Cell[BoxData[ RowBox[{"PtRadius", " ", "->", " ", "rd"}], ",", "filopts"}], "]"}]}]}], "\n", " ", "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"f733c44e-ea24-487a-a0e7-14863e065620"], + ";"}]], "Code",ExpressionUUID->"ff0e0f22-10c3-4638-8ee3-092662d20b3a"], Cell[BoxData[ RowBox[{ @@ -2232,9 +2231,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Length", "[", "nuccoord", "]"}], " ", "!=", " ", "0"}], ",", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "nuccoord"}], "]"}], ",", " ", "True", - ",", " ", "1"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", " ", "nuccoord", "]"}], ",", " ", "True", ",", + " ", "1"}], "]"}]}], ";", "\n", " ", RowBox[{"nuccoord", " ", "=", " ", RowBox[{"Which", "[", RowBox[{ @@ -2271,7 +2269,7 @@ Cell[BoxData[ RowBox[{"SyncDim", " ", "->", "dld4"}], ",", RowBox[{"PtRadius", " ", "->", " ", "rd"}], ",", "filopts"}], "]"}]}]}], "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->\ -"776def38-dbf3-4def-bec9-2d1500f7ac17"], +"eb17bf0a-c7ae-48d2-b99e-6b3e48e28e6f"], Cell[BoxData[{ RowBox[{ @@ -2310,9 +2308,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Length", "[", "mnccoord", "]"}], " ", "!=", " ", "0"}], ",", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "mnccoord"}], "]"}], ",", " ", "True", - ",", " ", "1"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", " ", "mnccoord", "]"}], ",", " ", "True", ",", + " ", "1"}], "]"}]}], ";", "\n", " ", RowBox[{"mnccoord", " ", "=", " ", RowBox[{"Which", "[", RowBox[{ @@ -2383,8 +2380,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Length", "[", "shapcoord", "]"}], " ", "!=", " ", "0"}], ",", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "shapcoord"}], "]"}], ",", "True", ",", "1"}], + RowBox[{"Total", "[", "shapcoord", "]"}], ",", "True", ",", "1"}], "]"}]}], ";", "\n", " ", RowBox[{"shapcoord", " ", "=", " ", RowBox[{"Which", "[", @@ -2424,8 +2420,8 @@ Cell[BoxData[{ RowBox[{"PtRadius", " ", "->", " ", "rd"}], ",", "filopts"}], "]"}]}]}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "retval", "]"}]}]}], "\n", "]"}]}], - ";"}], "\n"}], "Code",ExpressionUUID->"5d79112a-b633-42d8-8001-\ -206fc05f7ea9"], + ";"}], "\n"}], "Code",ExpressionUUID->"08ca9927-de22-4507-964f-\ +2a9568996092"], Cell[BoxData[ RowBox[{ @@ -2482,7 +2478,7 @@ Cell[BoxData[ RowBox[{"1", ",", "0", ",", "0"}], "]"}], ",", " ", "sph"}], " ", "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"86ff7ee3-eacf-470a-92d4-d38cd1896df1"], + ";"}]], "Code",ExpressionUUID->"369efd3d-4325-4d51-9036-c3da88b79913"], Cell[BoxData[{ RowBox[{ @@ -2520,14 +2516,12 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Depth", "[", "paycoord", "]"}], " ", "==", " ", "2"}], ",", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "paycoord"}], "]"}], ",", "\n", "\t\t ", + RowBox[{"Total", "[", "paycoord", "]"}], ",", "\n", "\t\t ", RowBox[{ RowBox[{"Depth", "[", "paycoord", "]"}], " ", "==", " ", "3"}], ",", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", - RowBox[{"First", "[", "paycoord", "]"}]}], "]"}], ",", "\n", + RowBox[{"Total", "[", + RowBox[{"First", "[", "paycoord", "]"}], "]"}], ",", "\n", "\t\t ", "True", ",", "1"}], "]"}]}], ";", "\n", " ", RowBox[{"paycoord", "=", " ", RowBox[{"Which", "[", @@ -2710,7 +2704,7 @@ Cell[BoxData[{ RowBox[{"Position", "[", RowBox[{"varl", ",", "minv"}], "]"}]}], ";", "\n", " ", RowBox[{"First", "[", "psm", "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",E\ -xpressionUUID->"f9036ac9-cdc7-4b84-b9b6-4d2d08edb508"], +xpressionUUID->"4fb1159a-a2d2-4840-a74e-9380a0bc26c1"], Cell[BoxData[ RowBox[{ @@ -2765,7 +2759,7 @@ Cell[BoxData[ RowBox[{"Green", ",", " ", "sph"}], " ", "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"29a1141e-1848-411f-9d70-64db230b31c6"], + ";"}]], "Code",ExpressionUUID->"ac110388-a811-46ff-8af8-04879ca748c8"], Cell[BoxData[ RowBox[{ @@ -2820,7 +2814,7 @@ Cell[BoxData[ RowBox[{"Purple", ",", " ", "sph"}], " ", "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"57bea743-a65f-4947-bf33-e0e20913f262"], + ";"}]], "Code",ExpressionUUID->"0c019de9-86d4-422c-b3df-a36e14ea237e"], Cell[BoxData[ RowBox[{ @@ -2877,7 +2871,7 @@ Cell[BoxData[ RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", " ", "sph"}], " ", "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"3c581eb3-98da-443b-bd63-8809412618dc"], + ";"}]], "Code",ExpressionUUID->"787a731d-cfa4-48af-a154-d38b76bae58b"], Cell[BoxData[ RowBox[{ @@ -2957,8 +2951,8 @@ Cell[BoxData[ RowBox[{"Graphics3D", "[", RowBox[{"sph", " ", ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", " ", "]"}]}], - ";"}], "\n"}]], "Code",ExpressionUUID->"a89983bf-cb0f-4219-9673-\ -b1c4b1873a1d"], + ";"}], "\n"}]], "Code",ExpressionUUID->"c35f9188-a848-4dcb-bc3c-\ +4877afa5dc19"], Cell[BoxData[ RowBox[{ @@ -2989,8 +2983,7 @@ Cell[BoxData[ RowBox[{"Options", "[", "Graphics3D", "]"}]}], "]"}]}], ";", " ", "\n", " ", RowBox[{"pr", "=", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "payoff"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "payoff", "]"}]}], ";", "\n", " ", RowBox[{"pay1", "=", RowBox[{"payoff", "/", "pr"}]}], ";", "\n", " ", RowBox[{"reddim", "=", @@ -3022,7 +3015,7 @@ Cell[BoxData[ RowBox[{"0", ",", "1", ",", "0"}], "]"}], ",", " ", "sph"}], " ", "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"34a1f610-b156-4059-8b0d-f38e33c366b2"], + ";"}]], "Code",ExpressionUUID->"939bb114-b2e4-453c-8d9a-4044be0b5c53"], Cell[BoxData[ RowBox[{ @@ -3076,7 +3069,7 @@ Cell[BoxData[ RowBox[{"Yellow", ",", " ", "crseg"}], " ", "}"}], ",", "filopts"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"1ac7fb60-5236-4925-8703-7f5d8bf8632a"], + ";"}]], "Code",ExpressionUUID->"37b02df8-8234-4b20-a131-85715aefa94e"], Cell[BoxData[{ RowBox[{ @@ -3437,7 +3430,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"DetDim2Del", "[", RowBox[{"game_", ",", - RowBox[{"vert_:", + RowBox[{"vert_", ":", RowBox[{"{", "}"}]}]}], "]"}], ":=", " ", RowBox[{"Module", "[", RowBox[{ @@ -3608,8 +3601,8 @@ Cell[BoxData[{ RowBox[{"Tube", "[", "redead", "]"}]}], "]"}]}], "}"}], ",", "filopts"}], "]"}]}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], - ";"}], "\n"}], "Code",ExpressionUUID->"e74a0636-cb4a-433b-97dd-\ -cb0e2d8d4818"], + ";"}], "\n"}], "Code",ExpressionUUID->"09cf20d1-8cbe-44c0-b0a7-\ +eede28c53780"], Cell[BoxData[{ RowBox[{ @@ -3743,17 +3736,18 @@ Cell[BoxData[{ RowBox[{"Return", "[", "gr", "]"}], ";"}]}], "\n", "]"}]}], ";"}], "\n"}], "\n", RowBox[{ - RowBox[{"End", "[", "]"}], ";"}]}], "Code",ExpressionUUID->"1924c6c0-e304-\ -42c1-bc23-c44c9bc9fbc3"], + RowBox[{"End", "[", "]"}], ";"}]}], "Code",ExpressionUUID->"c9dbd7e2-4002-\ +4e6a-844f-28bb75aa66ed"], Cell[BoxData[ RowBox[{ - RowBox[{"EndPackage", "[", "]"}], "\n"}]], "Code",ExpressionUUID->"8f0a1f23-0644-46cb-9054-61f464d3c40c"] + RowBox[{"EndPackage", "[", "]"}], "\n"}]], "Code",ExpressionUUID->"0fdfde68-bbfa-4986-9137-a87e3f635565"] }, -WindowSize->{630, 827}, -WindowMargins->{{278, Automatic}, {Automatic, 82}}, -FrontEndVersion->"11.3 for Linux x86 (64-bit) (March 6, 2018)", -StyleDefinitions->"Default.nb" +WindowSize->{808, 869}, +WindowMargins->{{144, Automatic}, {91, Automatic}}, +FrontEndVersion->"12.1 for Linux x86 (64-bit) (March 18, 2020)", +StyleDefinitions->"Default.nb", +ExpressionUUID->"3c427da1-baf5-49e5-b60b-0dc5c8bd5353" ] (* End of Notebook Content *) @@ -3766,28 +3760,28 @@ CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ -Cell[558, 20, 5356, 105, 1189, "Code",ExpressionUUID->"5f1a0273-539d-4071-bb69-7aa2fcebc15e"], -Cell[5917, 127, 982, 25, 315, "Code",ExpressionUUID->"b7b89c2f-5b14-4d43-b4de-f38de49ec215"], -Cell[6902, 154, 3458, 86, 1097, "Code",ExpressionUUID->"a768d61e-ef3d-4474-94dd-370c691f5e77"], -Cell[10363, 242, 19875, 446, 70, "Code",ExpressionUUID->"6f5cbcb1-b3bd-442c-a131-a94632b464e3"], -Cell[30241, 690, 19020, 449, 70, "Code",ExpressionUUID->"df9e75c8-f345-496a-b30d-e344c381373a"], -Cell[49264, 1141, 21710, 499, 70, "Code",ExpressionUUID->"9a45f789-b6db-47cf-a7f3-c4473175b9d7"], -Cell[70977, 1642, 2200, 54, 70, "Code",ExpressionUUID->"5d6136d4-8ce8-4c41-a526-0ca3d468b66f"], -Cell[73180, 1698, 16878, 368, 70, "Code",ExpressionUUID->"f75ba8a0-95f9-4cbf-9cfb-243360848c72"], -Cell[90061, 2068, 5337, 128, 70, "Code",ExpressionUUID->"f733c44e-ea24-487a-a0e7-14863e065620"], -Cell[95401, 2198, 3087, 75, 70, "Code",ExpressionUUID->"776def38-dbf3-4def-bec9-2d1500f7ac17"], -Cell[98491, 2275, 6306, 152, 70, "Code",ExpressionUUID->"5d79112a-b633-42d8-8001-206fc05f7ea9"], -Cell[104800, 2429, 2157, 55, 70, "Code",ExpressionUUID->"86ff7ee3-eacf-470a-92d4-d38cd1896df1"], -Cell[106960, 2486, 8915, 226, 70, "Code",ExpressionUUID->"f9036ac9-cdc7-4b84-b9b6-4d2d08edb508"], -Cell[115878, 2714, 2080, 53, 70, "Code",ExpressionUUID->"29a1141e-1848-411f-9d70-64db230b31c6"], -Cell[117961, 2769, 2080, 53, 70, "Code",ExpressionUUID->"57bea743-a65f-4947-bf33-e0e20913f262"], -Cell[120044, 2824, 2158, 55, 70, "Code",ExpressionUUID->"3c581eb3-98da-443b-bd63-8809412618dc"], -Cell[122205, 2881, 3155, 79, 70, "Code",ExpressionUUID->"a89983bf-cb0f-4219-9673-b1c4b1873a1d"], -Cell[125363, 2962, 2432, 62, 70, "Code",ExpressionUUID->"34a1f610-b156-4059-8b0d-f38e33c366b2"], -Cell[127798, 3026, 2140, 52, 70, "Code",ExpressionUUID->"1ac7fb60-5236-4925-8703-7f5d8bf8632a"], -Cell[129941, 3080, 22121, 531, 70, "Code",ExpressionUUID->"e74a0636-cb4a-433b-97dd-cb0e2d8d4818"], -Cell[152065, 3613, 5250, 133, 70, "Code",ExpressionUUID->"1924c6c0-e304-42c1-bc23-c44c9bc9fbc3"], -Cell[157318, 3748, 131, 2, 70, "Code",ExpressionUUID->"8f0a1f23-0644-46cb-9054-61f464d3c40c"] +Cell[558, 20, 5440, 106, 1182, "Code",ExpressionUUID->"1d02bdcf-d6f7-4ad0-aba0-8d490ebd57ac"], +Cell[6001, 128, 982, 25, 303, "Code",ExpressionUUID->"8845b317-8fb2-42e2-88f6-3a982cd415c5"], +Cell[6986, 155, 3458, 86, 1050, "Code",ExpressionUUID->"491176fb-6bd1-46e4-9139-5b3eb1ae1446"], +Cell[10447, 243, 19875, 446, 70, "Code",ExpressionUUID->"b8bc213d-0aee-48a9-b856-90ee7bbb042d"], +Cell[30325, 691, 19020, 449, 70, "Code",ExpressionUUID->"8de4d22f-4aae-4d40-81aa-7a55732f513e"], +Cell[49348, 1142, 21710, 499, 70, "Code",ExpressionUUID->"7147c352-20c1-482a-8396-f717dcef3025"], +Cell[71061, 1643, 2200, 54, 70, "Code",ExpressionUUID->"b0aed142-14aa-4147-afe7-78f6e72f79aa"], +Cell[73264, 1699, 16878, 368, 70, "Code",ExpressionUUID->"96dfe838-3d72-4caa-b383-40eb7ccf73b7"], +Cell[90145, 2069, 5267, 126, 70, "Code",ExpressionUUID->"ff0e0f22-10c3-4638-8ee3-092662d20b3a"], +Cell[95415, 2197, 3053, 74, 70, "Code",ExpressionUUID->"eb17bf0a-c7ae-48d2-b99e-6b3e48e28e6f"], +Cell[98471, 2273, 6237, 150, 70, "Code",ExpressionUUID->"08ca9927-de22-4507-964f-2a9568996092"], +Cell[104711, 2425, 2157, 55, 70, "Code",ExpressionUUID->"369efd3d-4325-4d51-9036-c3da88b79913"], +Cell[106871, 2482, 8844, 224, 70, "Code",ExpressionUUID->"4fb1159a-a2d2-4840-a74e-9380a0bc26c1"], +Cell[115718, 2708, 2080, 53, 70, "Code",ExpressionUUID->"ac110388-a811-46ff-8af8-04879ca748c8"], +Cell[117801, 2763, 2080, 53, 70, "Code",ExpressionUUID->"0c019de9-86d4-422c-b3df-a36e14ea237e"], +Cell[119884, 2818, 2158, 55, 70, "Code",ExpressionUUID->"787a731d-cfa4-48af-a154-d38b76bae58b"], +Cell[122045, 2875, 3155, 79, 70, "Code",ExpressionUUID->"c35f9188-a848-4dcb-bc3c-4877afa5dc19"], +Cell[125203, 2956, 2400, 61, 70, "Code",ExpressionUUID->"939bb114-b2e4-453c-8d9a-4044be0b5c53"], +Cell[127606, 3019, 2140, 52, 70, "Code",ExpressionUUID->"37b02df8-8234-4b20-a131-85715aefa94e"], +Cell[129749, 3073, 22125, 531, 70, "Code",ExpressionUUID->"09cf20d1-8cbe-44c0-b0a7-eede28c53780"], +Cell[151877, 3606, 5250, 133, 70, "Code",ExpressionUUID->"c9dbd7e2-4002-4e6a-844f-28bb75aa66ed"], +Cell[157130, 3741, 131, 2, 70, "Code",ExpressionUUID->"0fdfde68-bbfa-4986-9137-a87e3f635565"] } ] *) diff --git a/IOTuGamesV6.m b/IOTuGamesV6.wl similarity index 98% rename from IOTuGamesV6.m rename to IOTuGamesV6.wl index 780a442..b7f19a3 100644 --- a/IOTuGamesV6.m +++ b/IOTuGamesV6.wl @@ -1,7 +1,9 @@ +(* ::Package:: *) + (* : Title : IOTuGamesV6.m - : Release Date : 20.01.2019 - : Version 2.5 + : Release Date : 22.04.2020 + : Version 2.6.0 *) @@ -47,7 +49,9 @@ and can therefore adjusted by setting PtRadius. Similar for the line segment of a two-dimensional Kernel, this is set to 0.75*PtRadius. In addition, the modiclus can be drawn by invoking the options ViewModiclusSol -> True. Finally, a bug - w.r.t. the option UseManipulate -> True has been fixed. + w.r.t. the option UseManipulate -> True has been fixed. + Version 2.6.0: + Performing some code maintenance. *) @@ -467,8 +471,8 @@ dpk=Depth[kersol]; {d1,d2}=If[dpk==2,{1,4} ,Dimensions[kersol]]; kersol=If[dpk == 3 && d1 == 1,First[kersol], kersol]; - normQ = Which[d1 === 1, Apply[Plus,kersol], - d1 === 2, Apply[Plus,#]&/@kersol, + normQ = Which[d1 === 1, Total[kersol], + d1 === 2, Total[#]&/@kersol, True,1]; kercoord = Which[d1 === 1, Which[normQ == 1, kersol, @@ -491,7 +495,7 @@ dld4= OptionValue[SyncDim]; rd = OptionValue[PtRadius]; filopts = FilterRules[{opts},Options[Graphics3D]]; - normQ = Which[Length[nuccoord] != 0, Apply[Plus, nuccoord], True, 1]; + normQ = Which[Length[nuccoord] != 0, Total[ nuccoord], True, 1]; nuccoord = Which[Length[nuccoord] != 0, Which[normQ == 1, nuccoord, True, nuccoord/normQ], True, nuccoord]; l1 = Depth[nuccoord]; Which[(Length[nuccoord]!=0 && l1==2)==True,GenNucleolusGraphPointV6[nuccoord,SyncDim ->dld4,PtRadius -> rd,filopts], @@ -505,7 +509,7 @@ dld4= OptionValue[SyncDim]; rd = OptionValue[PtRadius]; filopts = FilterRules[{opts},Options[Graphics3D]]; - normQ = Which[Length[mnccoord] != 0, Apply[Plus, mnccoord], True, 1]; + normQ = Which[Length[mnccoord] != 0, Total[ mnccoord], True, 1]; mnccoord = Which[Length[mnccoord] != 0, Which[normQ == 1, mnccoord, True, mnccoord/normQ], True, mnccoord]; l1 = Depth[mnccoord]; Which[(Length[mnccoord]!=0 && l1==2)==True,GenModiclusGraphPointV6[mnccoord,SyncDim ->dld4,PtRadius -> rd,filopts], @@ -518,7 +522,7 @@ dld4= OptionValue[SyncDim]; rd = OptionValue[PtRadius]; filopts = FilterRules[{opts},Options[Graphics3D]]; - normQ = Which[Length[shapcoord] != 0, Apply[Plus,shapcoord],True,1]; + normQ = Which[Length[shapcoord] != 0, Total[shapcoord],True,1]; shapcoord = Which[Length[shapcoord] != 0, Which[normQ == 1, shapcoord, True, shapcoord/normQ], True, shapcoord]; l1 = Depth[shapcoord]; retval=Which[(Length[shapcoord]!=0 && l1==2)==True,GenShapleyGraphPointV6[shapcoord,SyncDim ->dld4,PtRadius -> rd,filopts], @@ -548,8 +552,8 @@ dld4= OptionValue[SyncDim]; rd = OptionValue[PtRadius]; filopts = FilterRules[{opts},Options[Graphics3D]]; - normQ = Which[Depth[paycoord] == 2, Apply[Plus,paycoord], - Depth[paycoord] == 3, Apply[Plus,First[paycoord]], + normQ = Which[Depth[paycoord] == 2, Total[paycoord], + Depth[paycoord] == 3, Total[First[paycoord]], True,1]; paycoord= Which[Depth[paycoord] == 2, List[paycoord],True,paycoord]; paycoord =Which[Length[#] != 0, Which[normQ == 1, #, True, #/normQ], True, #] &/@ paycoord; @@ -664,7 +668,7 @@ dld4= OptionValue[SyncDim]; rd = OptionValue[PtRadius]; filopts = FilterRules[{opts},Options[Graphics3D]]; - pr=Apply[Plus,payoff]; + pr=Total[payoff]; pay1=payoff/pr; reddim=If[Length[pay1]==4, Which[SameQ[dld4,{}],RedDimV6[pay1], diff --git a/Kernel/init.m b/Kernel/init.m index 61e523d..ca34814 100644 --- a/Kernel/init.m +++ b/Kernel/init.m @@ -1,11 +1,15 @@ +$ParaMode="False"; +$NotebookMode="False"; +Off[Syntax::stresc] +Off[Options::optnf] +Off[OptionValue::nodef] +Off[Needs::nocont] +Off[Get::noopen] Get["TUG`coop`CooperativeGames`"]; Get["TUG`TuGames`"]; Get["TUG`TuGamesAux`"]; +Get["TUG`vertex`View3D`"]; Get["TUG`vertex`VertexEnum`"]; -Get["TUG`vertex`View3D`"]; Get["TUG`IOTuGamesV6`"]; Get["ComputationalGeometry`"]; -(* -$ParaMode="False"; -$NotebookMode="False"; -*) + diff --git a/MATtug.m b/MATtug.wl similarity index 99% rename from MATtug.m rename to MATtug.wl index 32c8c83..1cd193c 100644 --- a/MATtug.m +++ b/MATtug.wl @@ -1,3 +1,5 @@ +(* ::Package:: *) + (* : Title : MATtug : Release Date : 12.05.2019 diff --git a/PacletInfo.m b/PacletInfo.m index 55d8a87..92b1dfb 100644 --- a/PacletInfo.m +++ b/PacletInfo.m @@ -1,11 +1,11 @@ Paclet[ Name -> "TUG", - Version -> "2.5.4", + Version -> "2.6.0", MathematicaVersion -> "10+", Description -> "A Mathematica Package for Cooperative Game Theory", Creator -> "Holger Ingmar Meinhardt ", URL -> "https://github.com/himeinhardt/TuGames", - Thumbnail -> "TUGLogo.png", + Thumbnail -> "TUGLogo.png","Icon" -> "TUGLogo.png", Extensions -> { { "Kernel", Root -> ".", diff --git a/ParaTuGames.nb b/ParaTuGames.nb index 87ab12b..ec7f379 100644 --- a/ParaTuGames.nb +++ b/ParaTuGames.nb @@ -3,17 +3,17 @@ (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) -(* CreatedBy='Mathematica 11.3' *) +(* CreatedBy='Mathematica 12.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] -NotebookDataLength[ 174644, 4414] -NotebookOptionsPosition[ 169834, 4354] -NotebookOutlinePosition[ 170169, 4369] -CellTagsIndexPosition[ 170126, 4366] +NotebookDataLength[ 174671, 4412] +NotebookOptionsPosition[ 169804, 4351] +NotebookOutlinePosition[ 170196, 4367] +CellTagsIndexPosition[ 170153, 4364] WindowFrame->Normal*) (* Beginning of Notebook Content *) @@ -25,177 +25,181 @@ Cell[BoxData[ RowBox[{"ParaTuGames", ".", RowBox[{"m", "\n", " ", ":", " ", RowBox[{"Release", " ", "Date"}], " ", ":", " ", - RowBox[{"28.05", ".2019"}], "\n", " ", ":", " ", + RowBox[{"21.04", ".2020"}], "\n", " ", ":", " ", RowBox[{"Preliminary", " ", "version"}], ":", "\n", " ", RowBox[{"For", " ", "testing", " ", RowBox[{"only", "."}]}]}]}]}], "\n", "*)"}], "\n", - RowBox[{"(*", " ", - RowBox[{":", "Context", ":", " ", "TUG`ParaTuGames`"}], " ", "*)"}], "\n", - "\n", - RowBox[{"(*", " ", - RowBox[{":", "Summary", ":", "\t", "\n", " ", - RowBox[{ - "This", " ", "package", " ", "provides", " ", "some", " ", "extensions", - " ", "to", " ", "the", " ", "package", " ", "TuGame", " ", "for", " ", - "\n", " ", "modeling", " ", "and", " ", "calculating", " ", - "solutions", " ", "and", " ", "properties", " ", "for", " ", - "cooperative", " ", "games", " ", "with", " ", "\n", " ", - "transferable", " ", "utilities", " ", "in", " ", - RowBox[{"parallel", "."}]}]}], " ", "\n", "*)"}], "\t\t\t", "\n", "\n", - RowBox[{"(*", " ", - RowBox[{":", "Author", ":", "\t\t", "\n", " ", - RowBox[{ + RowBox[{ + RowBox[{"Off", "[", + RowBox[{"Needs", "::", "nocont"}], "]"}], "\n", + RowBox[{"(*", " ", + RowBox[{":", "Context", ":", " ", "TUG`ParaTuGames`"}], " ", "*)"}], "\n", + "\n", + RowBox[{"(*", " ", + RowBox[{":", "Summary", ":", "\t", "\n", " ", RowBox[{ - "Holger", " ", "Ingmar", " ", "Meinhardt", "\n", " ", "Department", - " ", "of", " ", "Economics", "\n", " ", "University", " ", "of", " ", - "Karlsruhe", " ", - RowBox[{"(", "KIT", ")"}], "\n", " ", - RowBox[{"holger", ".", - RowBox[{"meinhardt", "@", "wiwi"}], ".", "uni"}]}], "-", - RowBox[{"karlsruhe", ".", "de"}]}]}], "\n", "*)"}], "\n", "\n", - RowBox[{"(*", " ", - RowBox[{":", - RowBox[{"Package", " ", "Version"}], ":", " ", "0.4"}], " ", "*)"}], "\n", - "\n", - RowBox[{"(*", " ", "\n", " ", - RowBox[{ + "This", " ", "package", " ", "provides", " ", "some", " ", "extensions", + " ", "to", " ", "the", " ", "package", " ", "TuGame", " ", "for", " ", + "\n", " ", "modeling", " ", "and", " ", "calculating", " ", + "solutions", " ", "and", " ", "properties", " ", "for", " ", + "cooperative", " ", "games", " ", "with", " ", "\n", " ", + "transferable", " ", "utilities", " ", "in", " ", + RowBox[{"parallel", "."}]}]}], " ", "\n", "*)"}], "\t\t\t", "\n", "\n", + + RowBox[{"(*", " ", + RowBox[{":", "Author", ":", "\t\t", "\n", " ", + RowBox[{ + RowBox[{ + "Holger", " ", "Ingmar", " ", "Meinhardt", "\n", " ", "Department", + " ", "of", " ", "Economics", "\n", " ", "University", " ", "of", + " ", "Karlsruhe", " ", + RowBox[{"(", "KIT", ")"}], "\n", " ", + RowBox[{"holger", ".", + RowBox[{"meinhardt", "@", "wiwi"}], ".", "uni"}]}], "-", + RowBox[{"karlsruhe", ".", "de"}]}]}], "\n", "*)"}], "\n", "\n", + RowBox[{"(*", " ", RowBox[{":", - RowBox[{"Mathematica", " ", "Version"}], ":", " ", - RowBox[{"8.", "x"}]}], ",", " ", - RowBox[{"9.", "x"}], ",", " ", - RowBox[{"10.", "x"}], ",", " ", - RowBox[{"11.", "x"}], ",", " ", - RowBox[{"12.", "x"}]}], "\n", "\n", "*)"}], "\n", - RowBox[{"(*", - RowBox[{ - RowBox[{":", "Keywords", ":", "\n", " ", - RowBox[{"Dual", " ", "Game"}]}], ",", " ", - RowBox[{"Superadditive", " ", "Game"}], ",", " ", - RowBox[{"Convex", " ", "Game"}], ",", " ", - RowBox[{"Strong", " ", "Convex", " ", "Game"}], ",", " ", - RowBox[{"Average", "-", - RowBox[{"Convex", " ", "Game"}]}], ",", "\n", " ", "Kernel", ",", " ", - - RowBox[{"balancing", " ", "Maximum", " ", - RowBox[{"Excesses", "."}]}]}], "\n", "*)"}], "\n", "\n", - RowBox[{"(*", " ", - RowBox[{ - RowBox[{":", "Sources", ":", "\n", " ", "\n", " ", - RowBox[{"Theo", " ", "Driessen"}]}], ",", " ", - RowBox[{"Cooperative", " ", "Games"}], ",", " ", - RowBox[{"Solutions", " ", "and", " ", "Applications"}], ",", " ", - RowBox[{"Kluwer", " ", "Academic", "\n", " ", "Publishers"}], ",", " ", - "Dordrecht", ",", " ", - RowBox[{"1988.", "\n", "\n", " ", - RowBox[{"E", ".", " ", "Inarra"}], " ", "and", " ", - RowBox[{"J", ".", " ", "Usategui"}]}], ",", " ", + RowBox[{"Package", " ", "Version"}], ":", " ", "0.5"}], " ", "*)"}], + "\n", "\n", + RowBox[{"(*", " ", "\n", " ", RowBox[{ - "The", " ", "Shapley", " ", "value", " ", "and", " ", "average", " ", - "convex", " ", "games"}], ",", " ", "\n", " ", "IJGT", ",", " ", "22", - ",", " ", - RowBox[{"13", "-", "29"}], ",", " ", - RowBox[{"1993.", "\n", "\n", " ", - RowBox[{"M", ".", " ", "Maschler"}]}], ",", " ", - RowBox[{"The", " ", "Bargaining", " ", "Set"}], ",", " ", - RowBox[{"Kernel", " ", "and", " ", "Nucleolus"}], ",", " ", - RowBox[{"Handbook", " ", "of", " ", "Game", "\n", " ", "Theory"}], ",", - " ", - RowBox[{"Chapter", " ", "18"}], ",", " ", - RowBox[{"591", "-", "647"}], ",", " ", - RowBox[{"1992.", "\n", "\n", " ", - RowBox[{"M", ".", " ", "Maschler"}]}], ",", " ", + RowBox[{":", + RowBox[{"Mathematica", " ", "Version"}], ":", " ", + RowBox[{"8.", "x"}]}], ",", " ", + RowBox[{"9.", "x"}], ",", " ", + RowBox[{"10.", "x"}], ",", " ", + RowBox[{"11.", "x"}], ",", " ", + RowBox[{"12.", "x"}]}], "\n", "\n", "*)"}], "\n", + RowBox[{"(*", RowBox[{ - RowBox[{"B", ".", " ", "Peleg"}], " ", "and", " ", - RowBox[{"L", ".", "S", ".", " ", "Shapley"}]}], ",", " ", - RowBox[{"Geometric", " ", "Properties", " ", "of", " ", "Kernel"}], ",", - " ", "\n", " ", - RowBox[{"Nucleolus", " ", "and", " ", "related", " ", "Concepts"}], ",", - " ", - RowBox[{ - "in", " ", "Mathematics", " ", "of", " ", "Operations", " ", "Research"}], - ",", " ", "\n", " ", - RowBox[{"Vol4", " ", - RowBox[{"Nov", ".", " ", "1979"}]}], ",", " ", - RowBox[{ - RowBox[{"p", ".", " ", "303"}], "-", - RowBox[{"338.", "\n", "\n", " ", "J"}], "-", - RowBox[{"E", ".", " ", "Martinez"}], "-", "Legaz"}], ",", " ", + RowBox[{":", "Keywords", ":", "\n", " ", + RowBox[{"Dual", " ", "Game"}]}], ",", " ", + RowBox[{"Superadditive", " ", "Game"}], ",", " ", + RowBox[{"Convex", " ", "Game"}], ",", " ", + RowBox[{"Strong", " ", "Convex", " ", "Game"}], ",", " ", + RowBox[{"Average", "-", + RowBox[{"Convex", " ", "Game"}]}], ",", "\n", " ", "Kernel", ",", " ", + RowBox[{"balancing", " ", "Maximum", " ", + RowBox[{"Excesses", "."}]}]}], "\n", "*)"}], "\n", "\n", + RowBox[{"(*", " ", RowBox[{ + RowBox[{":", "Sources", ":", "\n", " ", "\n", " ", + RowBox[{"Theo", " ", "Driessen"}]}], ",", " ", + RowBox[{"Cooperative", " ", "Games"}], ",", " ", + RowBox[{"Solutions", " ", "and", " ", "Applications"}], ",", " ", + RowBox[{"Kluwer", " ", "Academic", "\n", " ", "Publishers"}], ",", " ", + "Dordrecht", ",", " ", + RowBox[{"1988.", "\n", "\n", " ", + RowBox[{"E", ".", " ", "Inarra"}], " ", "and", " ", + RowBox[{"J", ".", " ", "Usategui"}]}], ",", " ", RowBox[{ - "Dual", " ", "Representation", " ", "of", " ", "Cooperative", " ", - "Games", " ", "based", " ", "on", " ", "\n", " ", "Fenchel"}], "-", - RowBox[{"Moreau", " ", "Conjugation"}]}], ",", " ", "Optimization", ",", - " ", - RowBox[{ - RowBox[{"pp", ".", " ", "291"}], "-", "319"}], ",", " ", - RowBox[{"Vol", ".", " ", "36"}], ",", " ", - RowBox[{"1996.", "\n", "\n", " ", - RowBox[{"H", ".", " ", "I", ".", " ", "Meinhardt"}]}], ",", " ", - RowBox[{ + "The", " ", "Shapley", " ", "value", " ", "and", " ", "average", " ", + "convex", " ", "games"}], ",", " ", "\n", " ", "IJGT", ",", " ", "22", + ",", " ", + RowBox[{"13", "-", "29"}], ",", " ", + RowBox[{"1993.", "\n", "\n", " ", + RowBox[{"M", ".", " ", "Maschler"}]}], ",", " ", + RowBox[{"The", " ", "Bargaining", " ", "Set"}], ",", " ", + RowBox[{"Kernel", " ", "and", " ", "Nucleolus"}], ",", " ", + RowBox[{"Handbook", " ", "of", " ", "Game", "\n", " ", "Theory"}], ",", + " ", + RowBox[{"Chapter", " ", "18"}], ",", " ", + RowBox[{"591", "-", "647"}], ",", " ", + RowBox[{"1992.", "\n", "\n", " ", + RowBox[{"M", ".", " ", "Maschler"}]}], ",", " ", RowBox[{ - "An", " ", "LP", " ", "approach", " ", "to", " ", "compute", " ", "the", - " ", "pre"}], "-", - RowBox[{"kernel", " ", "for", " ", "cooperative", " ", "games"}]}], ",", - " ", "\n", " ", - RowBox[{"Computers", " ", "and", " ", "Operation", " ", "Research"}], ",", + RowBox[{"B", ".", " ", "Peleg"}], " ", "and", " ", + RowBox[{"L", ".", "S", ".", " ", "Shapley"}]}], ",", " ", + RowBox[{"Geometric", " ", "Properties", " ", "of", " ", "Kernel"}], ",", + " ", "\n", " ", + RowBox[{"Nucleolus", " ", "and", " ", "related", " ", "Concepts"}], ",", " ", - RowBox[{ - RowBox[{"Vol", " ", - RowBox[{"33", "/", "2"}], " ", - RowBox[{"pp", ".", " ", "535"}]}], "-", "557"}], ",", - RowBox[{"2006.", "\n", "\n", " ", - RowBox[{"H", ".", " ", "I", ".", " ", "Meinhardt"}]}], ",", " ", - RowBox[{ - RowBox[{"The", " ", "Pre"}], "-", RowBox[{ - "Kernel", " ", "as", " ", "a", " ", "Tractable", " ", "Solution", " ", - "for", " ", "Cooperative", " ", - RowBox[{"Games", ":", "\n", " ", - RowBox[{ - "An", " ", "Exercise", " ", "in", " ", "Algorithmic", " ", "Game", " ", - "Theory"}]}]}]}], ",", " ", - RowBox[{"forthcoming", " ", - RowBox[{"in", ":", " ", + "in", " ", "Mathematics", " ", "of", " ", "Operations", " ", + "Research"}], ",", " ", "\n", " ", + RowBox[{"Vol4", " ", + RowBox[{"Nov", ".", " ", "1979"}]}], ",", " ", + RowBox[{ + RowBox[{"p", ".", " ", "303"}], "-", + RowBox[{"338.", "\n", "\n", " ", "J"}], "-", + RowBox[{"E", ".", " ", "Martinez"}], "-", "Legaz"}], ",", " ", + RowBox[{ RowBox[{ - "Theory", " ", "and", " ", "Decision", " ", "Library", " ", "C"}]}]}], - ",", "\n", " ", - RowBox[{"Springer", " ", "Publisher"}], ",", " ", - RowBox[{ - RowBox[{"Heidelberg", ".", " ", "pp", ".", " ", "1"}], "-", "247"}], ",", - " ", - RowBox[{ - RowBox[{"2013.", " ", "\n", "\n", " ", - RowBox[{"A", ".", " ", "Meseguer"}]}], "-", "Artola"}], ",", " ", - RowBox[{ + "Dual", " ", "Representation", " ", "of", " ", "Cooperative", " ", + "Games", " ", "based", " ", "on", " ", "\n", " ", "Fenchel"}], "-", + RowBox[{"Moreau", " ", "Conjugation"}]}], ",", " ", "Optimization", ",", + " ", RowBox[{ - "Using", " ", "the", " ", "Indirect", " ", "Function", " ", "to", " ", - "characterize", " ", "the", " ", "Kernel", " ", "of", " ", "a", " ", - "TU"}], "-", "Game"}], ",", "\n", " ", - RowBox[{"Departament", " ", - RowBox[{"d", "'"}], "Economia", " ", "i", " ", - RowBox[{"d", "'"}], "Historia", " ", "Economica"}], ",", " ", - RowBox[{"1997.", " ", "\n", " ", "\n", " ", - RowBox[{"R", ".", " ", "T", ".", " ", "Rockafellar"}]}], ",", " ", - RowBox[{"Convex", " ", "Analysis"}], ",", " ", - RowBox[{"Princeton", " ", "University", " ", "Press"}], ",", " ", - RowBox[{"1970.", "\n", "\n", " ", - RowBox[{"R", ".", "E", ".", " ", "Stearns"}]}], ",", " ", - RowBox[{ + RowBox[{"pp", ".", " ", "291"}], "-", "319"}], ",", " ", + RowBox[{"Vol", ".", " ", "36"}], ",", " ", + RowBox[{"1996.", "\n", "\n", " ", + RowBox[{"H", ".", " ", "I", ".", " ", "Meinhardt"}]}], ",", " ", RowBox[{ - "Convergent", " ", "Transfer", " ", "Schemes", " ", "for", " ", "N"}], - "-", - RowBox[{"Person", " ", "Games"}]}], ",", "\n", " ", - RowBox[{ - "Transaction", " ", "American", " ", "Mathematical", " ", "Society"}], - ",", " ", - RowBox[{"449", "-", "459"}], ",", " ", - RowBox[{"1968.", "\n", "\n", " ", "Hal", " ", "Varian", " ", + RowBox[{ + "An", " ", "LP", " ", "approach", " ", "to", " ", "compute", " ", "the", + " ", "pre"}], "-", + RowBox[{"kernel", " ", "for", " ", "cooperative", " ", "games"}]}], ",", + " ", "\n", " ", + RowBox[{"Computers", " ", "and", " ", "Operation", " ", "Research"}], + ",", " ", + RowBox[{ + RowBox[{"Vol", " ", + RowBox[{"33", "/", "2"}], " ", + RowBox[{"pp", ".", " ", "535"}]}], "-", "557"}], ",", + RowBox[{"2006.", "\n", "\n", " ", + RowBox[{"H", ".", " ", "I", ".", " ", "Meinhardt"}]}], ",", " ", + RowBox[{ + RowBox[{"The", " ", "Pre"}], "-", + RowBox[{ + "Kernel", " ", "as", " ", "a", " ", "Tractable", " ", "Solution", " ", + "for", " ", "Cooperative", " ", + RowBox[{"Games", ":", "\n", " ", + RowBox[{ + "An", " ", "Exercise", " ", "in", " ", "Algorithmic", " ", "Game", + " ", "Theory"}]}]}]}], ",", " ", + RowBox[{"forthcoming", " ", + RowBox[{"in", ":", " ", + RowBox[{ + "Theory", " ", "and", " ", "Decision", " ", "Library", " ", "C"}]}]}], + ",", "\n", " ", + RowBox[{"Springer", " ", "Publisher"}], ",", " ", + RowBox[{ + RowBox[{"Heidelberg", ".", " ", "pp", ".", " ", "1"}], "-", "247"}], + ",", " ", RowBox[{ - RowBox[{"(", - RowBox[{"Ed", "."}], ")"}], ".", " ", "Economics"}], " ", "and", " ", - "Financial", " ", "Modeling", " ", "with", " ", "Mathematica"}], ",", - " ", "\n", " ", "Springer", ",", " ", "1992."}], " ", "\n", - "*)"}]}]], "Code",ExpressionUUID->"5a5efd71-9d4e-4597-94a7-3e3071dcc48e"], + RowBox[{"2013.", " ", "\n", "\n", " ", + RowBox[{"A", ".", " ", "Meseguer"}]}], "-", "Artola"}], ",", " ", + RowBox[{ + RowBox[{ + "Using", " ", "the", " ", "Indirect", " ", "Function", " ", "to", " ", + "characterize", " ", "the", " ", "Kernel", " ", "of", " ", "a", " ", + "TU"}], "-", "Game"}], ",", "\n", " ", + RowBox[{"Departament", " ", + RowBox[{"d", "'"}], "Economia", " ", "i", " ", + RowBox[{"d", "'"}], "Historia", " ", "Economica"}], ",", " ", + RowBox[{"1997.", " ", "\n", " ", "\n", " ", + RowBox[{"R", ".", " ", "T", ".", " ", "Rockafellar"}]}], ",", " ", + RowBox[{"Convex", " ", "Analysis"}], ",", " ", + RowBox[{"Princeton", " ", "University", " ", "Press"}], ",", " ", + RowBox[{"1970.", "\n", "\n", " ", + RowBox[{"R", ".", "E", ".", " ", "Stearns"}]}], ",", " ", + RowBox[{ + RowBox[{ + "Convergent", " ", "Transfer", " ", "Schemes", " ", "for", " ", "N"}], + "-", + RowBox[{"Person", " ", "Games"}]}], ",", "\n", " ", + RowBox[{ + "Transaction", " ", "American", " ", "Mathematical", " ", "Society"}], + ",", " ", + RowBox[{"449", "-", "459"}], ",", " ", + RowBox[{"1968.", "\n", "\n", " ", "Hal", " ", "Varian", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"Ed", "."}], ")"}], ".", " ", "Economics"}], " ", "and", " ", + "Financial", " ", "Modeling", " ", "with", " ", "Mathematica"}], ",", + " ", "\n", " ", "Springer", ",", " ", "1992."}], " ", "\n", + "*)"}]}]}]], "Code",ExpressionUUID->"a4c41654-76f8-40ed-9398-\ +df345e77e1de"], Cell[BoxData[ RowBox[{ @@ -264,7 +268,7 @@ Algorithm 8.2.1 of Meinhardt (2013))\>\""}], ";"}], "\n", "\n", "\"\\""}], - ";"}]}]}]], "Code",ExpressionUUID->"85587713-8b32-467e-9ca0-b36c8ce52aee"], + ";"}]}]}]], "Code",ExpressionUUID->"a5c357a7-4f2e-4219-a69b-f9e7d946b870"], Cell[BoxData[{ RowBox[{ @@ -285,16 +289,16 @@ original game. Do not confound this command\n with the function \ ModfiedNucleolus[]. The algorithm is based on a method by Peleg to translate\n\ the definition of the Nucleolus into a sequence of linear programs on the \ pre-imputation set.\n A simplex method is now used to increase its \ -computational reliability.\>\""}], ";"}]}], "Code",ExpressionUUID->"b2b2601f-\ -da15-4a69-a1e0-9204b4364084"], +computational reliability.\>\""}], ";"}]}], "Code",ExpressionUUID->"4eb1c92a-\ +da3c-4811-a12d-a47d817f65cb"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ParaIsModiclusQ", "::", "usage"}], " ", "=", " ", "\n", "\"\\""}], ";"}]], "Code",ExpressionUUID->"37c4e380-\ -7781-474a-ba7b-a19fb977dc8d"], +the modiclus of the game.\>\""}], ";"}]], "Code",ExpressionUUID->"a901925c-\ +481d-4bb1-82d0-45bf77da92f6"], Cell[BoxData[{ RowBox[{ @@ -337,8 +341,8 @@ the game.\>\""}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{"ParaIsSMPreKernelQ", "::", "usage"}], " ", "=", " ", "\n", "\"\\""}], ";"}], "\n"}], "Code",ExpressionUUID-\ ->"e290da9a-5e78-4a91-9649-f9410a2f996a"], +modified pre-kernel of the game.\>\""}], ";"}], "\n"}], "Code",ExpressionUUID->\ +"e89cb5d4-6f5a-4383-8b2c-174b0529ea11"], Cell[BoxData[ RowBox[{ @@ -347,7 +351,7 @@ Cell[BoxData[ "\"\\""}], ";"}]], "Code",ExpressionUUID->\ -"7a009f3c-f90e-4d78-963e-f0018ff5e80d"], +"0741bdc8-9faa-4eb8-aa21-18f563b8b076"], Cell[BoxData[ RowBox[{ @@ -360,7 +364,7 @@ reflects how the best arguments are distributed between a\n bargaining pair \ favor\n of the player i, zero means that the arguments are balanced, and a \ minus sign indicates that the\n arguments are skewed in favor of the player \ j. See also Meinhardt (2013).\>\""}], ";"}]], "Code",ExpressionUUID->\ -"18644561-a692-4094-a209-dd2badd8488f"], +"849bc064-002a-42d4-9314-f84d2deee6b9"], Cell[BoxData[{ RowBox[{ @@ -389,7 +393,7 @@ parallel.\>\""}], ";"}], "\n"}], "\n", RowBox[{"ParaCharacteristicValues", "::", "usage"}], " ", "=", "\n", "\"\\ -\""}], ";"}]}], "Code",ExpressionUUID->"09b92d97-2cee-486d-b241-a70c3395d8f2"], +\""}], ";"}]}], "Code",ExpressionUUID->"5261b491-2d6b-465a-b889-b8037e68a920"], Cell[BoxData[{ RowBox[{ @@ -522,7 +526,7 @@ Cell[BoxData[{ RowBox[{"SetSharedFunction", "[", "ParaTIJsets", "]"}], ";"}], "\n", RowBox[{ RowBox[{"SetSharedFunction", "[", "ParaW", "]"}], ";"}]}], "Code",Expression\ -UUID->"ecc88007-4327-4eb9-a573-c006260c7a46"], +UUID->"420e451a-e524-433a-988b-f650f2e395b4"], Cell[BoxData[ RowBox[{ @@ -577,7 +581,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"ParaSuperAdditiveQ", "::", "argerr"}], "=", "\"\\""}], ";"}]}]}]], "Code",ExpressionUUID\ -->"a8906218-5a05-4f86-9673-9d161de6a155"], +->"12b46d3a-f63b-4a53-9ef9-89706bbf6d50"], Cell[BoxData[ RowBox[{ @@ -637,7 +641,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"ParaSetsToVec", "::", "argerr"}], "=", "\"\\""}], ";"}]}]}]], "Code",ExpressionUU\ -ID->"e31066a9-47ad-4ae0-a997-edab233f5f25"], +ID->"b0708904-2b36-40f7-b499-1312565f3780"], Cell[BoxData[ RowBox[{ @@ -649,7 +653,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"ParaMaxSurplus", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", "\n"}]}]], "Code",\ -ExpressionUUID->"44e27c1a-1ded-4088-a63e-acfde201db6b"], +ExpressionUUID->"62d206eb-1151-4c32-881e-8dd14ce56861"], Cell[BoxData[ RowBox[{ @@ -695,8 +699,8 @@ Cell[BoxData[ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"ParaPreKernel", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"e5c9ad9d-d254-43e2-ac3b-\ -db06303d3611"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"9840ed6c-cf93-46bf-9b09-\ +1927903b403a"], Cell[BoxData[{ RowBox[{ @@ -860,8 +864,8 @@ Cell[BoxData[{ ";", "\n", " ", RowBox[{"ParaPreKernelAlg2", "[", RowBox[{"game", ",", "xvec", ",", "opts"}], "]"}]}]}], "]"}]}]}], - " ", "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"5fae082f-\ -36d2-4a98-88a2-384d92186b8e"], + " ", "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"16b3684d-\ +77fe-4461-b895-2f8192fbf2db"], Cell[BoxData[ RowBox[{ @@ -1083,7 +1087,7 @@ Cell[BoxData[ RowBox[{"Silent", " ", "->", " ", "sil"}], ",", " ", RowBox[{"SmallestCardinality", " ", "->", " ", "smc"}]}], "]"}]}], "]"}]}]}], " ", "\n", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->\ -"cac5c34a-61c8-43fd-88b0-a1f64de251b2"], +"75b66010-f974-4f48-9d84-6eda86d2212d"], Cell[BoxData[{ RowBox[{ @@ -1163,13 +1167,11 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "T", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "T"}]}], "]"}]}], " ", "/.", " ", "setpay"}]}], ";", "\n", " ", - + RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "T"}], + "]"}]}], " ", "/.", " ", "setpay"}]}], ";", "\n", " ", RowBox[{"PrependTo", "[", RowBox[{"submex", ",", " ", "grmex"}], "]"}], ";", "\n", " ", RowBox[{"If", "[", @@ -1279,8 +1281,8 @@ Cell[BoxData[{ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"ParaAntiPreKernel", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"8ee3fcfd-bd3f-4c1b-b350-\ -bb9d707b2d74"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"837af7f5-9115-460d-bd67-\ +616469ec9de2"], Cell[BoxData[ RowBox[{ @@ -1358,8 +1360,8 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"ParaPrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]], "Code",ExpressionUUID->"0ffb7e21-0310-4f96-a5bf-\ -e4aab6f1b7ee"], + "]"}]}], ";"}]], "Code",ExpressionUUID->"e02caab1-a38b-44eb-8a02-\ +2753b4400032"], Cell[BoxData[ RowBox[{ @@ -1443,8 +1445,8 @@ Cell[BoxData[ ";", "\n", " ", RowBox[{"ParaAntiPreKernelAlg2", "[", RowBox[{"game", ",", "xvec", ",", "opts"}], "]"}]}]}], "]"}]}]}], - " ", "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUUID->"d0fb24d5-a906-\ -42b5-92d7-21376a7b7564"], + " ", "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUUID->"d9792476-c39d-\ +45f2-aac0-bfec0e3b56e9"], Cell[BoxData[ RowBox[{ @@ -1562,8 +1564,8 @@ Cell[BoxData[ RowBox[{"Redefine", " ", "the", " ", "original", " ", RowBox[{"game", "."}]}], " ", "*)"}], "\n", " ", RowBox[{"Return", "[", "bcQ", "]"}]}]}], "\n", " ", - "]"}]}]}]}]], "Code",ExpressionUUID->"4da23308-4fba-43b8-a40b-\ -090c55fcaa31"], + "]"}]}]}]}]], "Code",ExpressionUUID->"43287316-9609-4890-b1c9-\ +dcf81a1351a5"], Cell[BoxData[{ RowBox[{ @@ -1799,7 +1801,7 @@ Cell[BoxData[{ RowBox[{"Silent", " ", "->", " ", "sil"}], ",", " ", RowBox[{"SmallestCardinality", " ", "->", " ", "smc"}]}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->\ -"df779990-e349-45e8-9ef2-e696a390ff8b"], +"fb13b87b-0d34-4853-a4d2-8f801303f7c0"], Cell[BoxData[ RowBox[{ @@ -1882,8 +1884,8 @@ Cell[BoxData[ RowBox[{"{", RowBox[{"vals", ",", " ", RowBox[{"v", "[", "T", "]"}]}], "}"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]], "Code",ExpressionUUID->"49e8806d-7511-43a3-b57b-\ -8ab8b5c48069"], + "]"}]}], ";"}]], "Code",ExpressionUUID->"2f0b2290-9069-4861-9420-\ +1fcf629fbe9d"], Cell[BoxData[{ RowBox[{ @@ -1945,7 +1947,7 @@ Cell[BoxData[{ RowBox[{"game", "."}]}], " ", "*)"}], "\n", " ", RowBox[{"Take", "[", RowBox[{"mdnc", ",", " ", "lt"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"2d60fcf1-00bd-4652-a3f7-edb1c66c1eea"], + ";"}]}], "Code",ExpressionUUID->"d1098ab9-dc1e-46cd-b272-68dcfd4ea6be"], Cell[BoxData[ RowBox[{ @@ -2005,7 +2007,7 @@ Cell[BoxData[ RowBox[{"game", "."}]}], " ", "*)"}], "\n", " ", RowBox[{"Take", "[", RowBox[{"mdnc", ",", " ", "lt"}], "]"}]}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"98ac9313-3ada-4030-8eb0-52b75ab3a12d"], + ";"}]], "Code",ExpressionUUID->"483b0c1c-41a5-41c9-b028-388390ff3633"], Cell[BoxData[{ RowBox[{ @@ -2207,7 +2209,7 @@ Cell[BoxData[{ "dlext"}]}], ";", "\n", " ", RowBox[{"{", RowBox[{"vals", ",", " ", "dlext"}], "}"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"69d06600-f78b-47f5-9083-1b0f622c6ed6"], + ";"}]}], "Code",ExpressionUUID->"c1cb2cb0-affe-4481-8bba-466bdffd6830"], Cell[BoxData[ RowBox[{ @@ -2303,7 +2305,7 @@ Cell[BoxData[ "plext"}]}], ";", "\n", " ", RowBox[{"{", RowBox[{"vals", ",", " ", "plext"}], "}"}]}]}], "\n", " ", "]"}]}], - ";"}]}]], "Code",ExpressionUUID->"d248f471-15bd-4d16-a8d0-44860bb88273"], + ";"}]}]], "Code",ExpressionUUID->"06ddd9bf-8fc4-4d0b-9d6c-f963fe342eeb"], Cell[BoxData[ RowBox[{ @@ -2331,8 +2333,8 @@ Cell[BoxData[ RowBox[{"#1", ",", " ", "#2"}], "]"}], " ", "&"}], ",", " ", RowBox[{"{", RowBox[{"dvals", ",", " ", "pvals"}], "}"}]}], "]"}]}]}], "\n", - "]"}]}], ";"}]], "Code",ExpressionUUID->"3b7149a6-eb3e-4bce-a918-\ -150d618ba805"], + "]"}]}], ";"}]], "Code",ExpressionUUID->"fa8d75b9-fdac-4d2b-816e-\ +3fdcfd73c062"], Cell[BoxData[ RowBox[{"(*", " ", @@ -2342,8 +2344,8 @@ Cell[BoxData[ " ", "the", " ", "simplified", " ", "modified", " ", "pre"}], "-", RowBox[{ RowBox[{"kernel", "/", "nucleolus"}], " ", "of", " ", "a", " ", - RowBox[{"game", "."}]}]}], " ", "*)"}]], "Code",ExpressionUUID->"147f03a3-\ -1829-40da-9c0b-59e30c2c2330"], + RowBox[{"game", "."}]}]}], " ", "*)"}]], "Code",ExpressionUUID->"fb70a0d0-\ +4fc4-4774-b981-bad53e023c05"], Cell[BoxData[{ RowBox[{ @@ -2439,8 +2441,8 @@ Cell[BoxData[{ RowBox[{"Redefine", " ", "the", " ", "original", " ", RowBox[{"game", "."}]}], "*)"}], "\n", " ", RowBox[{"Return", "[", "smpkQ", "]"}], ";"}]}], "\n", " ", "]"}]}], - ";"}], "\n"}], "Code",ExpressionUUID->"0309aaad-f856-45a1-a29a-\ -8a44fb62aa1c"], + ";"}], "\n"}], "Code",ExpressionUUID->"6f6e49b5-afea-42b4-b2f6-\ +4509894b14e7"], Cell[BoxData[ RowBox[{ @@ -2540,7 +2542,7 @@ Cell[BoxData[ RowBox[{"{", RowBox[{"i", ",", " ", "1", ",", " ", RowBox[{"Length", "[", "T", "]"}]}], "}"}]}], "]"}], "]"}]}], ";"}], - "\n"}]}]], "Code",ExpressionUUID->"5c469120-5c46-4c7a-a379-5f5adea048a4"], + "\n"}]}]], "Code",ExpressionUUID->"994a8927-d933-4131-b778-8f90520dbb6a"], Cell[BoxData[ RowBox[{ @@ -2667,8 +2669,8 @@ Cell[BoxData[ ",", RowBox[{"{", RowBox[{"sigcoal", ",", "amax"}], "}"}]}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->"4b9982dd-4e9b-4c06-917a-\ -799ce4271e88"], + "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->"59962d10-2b71-4b6c-95d8-\ +bd30c8869539"], Cell[BoxData[ RowBox[{ @@ -2751,7 +2753,7 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"First", "[", "extcoal", "]"}]}], "]"}]}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUUID->\ -"9a77a759-2d41-4f01-8e2b-2a74acce8efe"], +"9e6dfd80-e01e-4491-a780-57b7606f37ff"], Cell[BoxData[{ RowBox[{ @@ -2826,8 +2828,8 @@ Cell[BoxData[{ RowBox[{"effvec", "==", "True"}], ",", " ", RowBox[{"Prepend", "[", RowBox[{"coasts", ",", "onesoft"}], "]"}], ",", " ", "coasts"}], - "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"2f1d3338-\ -b2fe-4c74-8faf-42e00792404f"], + "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"ebc6f6d7-\ +5315-45ac-8522-68e617b887ee"], Cell[BoxData[{ RowBox[{ @@ -2932,7 +2934,7 @@ Cell[BoxData[{ RowBox[{"minpi", ",", "minpj"}], "}"}]}], "]"}]}], ",", RowBox[{"Method", " ", "->", " ", "\"\\""}], ",", RowBox[{"DistributedContexts", " ", "->", " ", "None"}]}], "]"}]}], - "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"6620ef8f-9fe2-4cdf-a214-ba90b0f608ea"], + "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"ef373b17-04c9-4c99-8cd6-2b889080a060"], Cell[BoxData[{ RowBox[{ @@ -3017,7 +3019,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";", RowBox[{"Return", "[", "]"}]}]}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"850cf05e-6e27-425e-aa79-7acdd335ae69"], + ";"}]}], "Code",ExpressionUUID->"e7354b84-3b40-44a6-911e-2976550f4f08"], Cell[BoxData[{ RowBox[{ @@ -3108,7 +3110,7 @@ Cell[BoxData[{ RowBox[{"___", ",", "i", ",", "___"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"___", ",", "j", ",", "___"}], "}"}]}], "]"}]}], ";"}]}], "Code",\ -ExpressionUUID->"12766840-4a6f-4dcb-b971-77f472762f4f"], +ExpressionUUID->"796e0d42-0be9-4844-8841-a4c2eb5c1469"], Cell[BoxData[{ RowBox[{ @@ -3212,7 +3214,7 @@ Cell[BoxData[{ RowBox[{"MatrixForm", "[", RowBox[{"PrependTo", "[", RowBox[{"exc", ",", "mpc"}], "]"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"59e3a928-f6bf-41c8-b33a-52936806457f"], + ";"}]}], "Code",ExpressionUUID->"5e4f0512-15d6-4794-adc1-783deb0e3360"], Cell[BoxData[ RowBox[{ @@ -3276,8 +3278,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "-", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "-", " ", "graval"}], "]"}], "<=", "tolv"}], ")"}], " ", "&"}], " ", "/@", " ", "payoff"}], ",", RowBox[{"ParaMaxExcessBalanced", "[", @@ -3308,9 +3309,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "payoff"}], "]"}], " ", "-", - " ", "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", + RowBox[{"Total", "[", "payoff", "]"}], " ", "-", " ", + "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", RowBox[{"{", RowBox[{"ParaMaxExcessBalanced", "[", RowBox[{"game", ",", " ", "payoff"}], "]"}], "}"}]}], @@ -3321,7 +3321,7 @@ Cell[BoxData[ "\n", " ", "True", ",", " ", RowBox[{"ParaPrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}]}]}]], "Code",Exp\ -ressionUUID->"4bf9d0ce-9f98-4420-824b-26380804bc71"], +ressionUUID->"c449cad0-cf0a-4ea4-b797-34b1e1e38309"], Cell[BoxData[{ RowBox[{ @@ -3376,8 +3376,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "-", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "-", " ", "graval"}], "]"}], "<=", " ", "tolv"}], ")"}], " ", "&"}], " ", "/@", " ", "payoff"}], ",", RowBox[{"ParaMinExcessBalanced", "[", @@ -3407,9 +3406,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "payoff"}], "]"}], " ", "-", " ", - "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", + RowBox[{"Total", "[", "payoff", "]"}], " ", "-", " ", + "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", RowBox[{"{", RowBox[{"ParaMinExcessBalanced", "[", RowBox[{"game", ",", " ", "payoff"}], "]"}], "}"}]}], "}"}]}], @@ -3419,7 +3417,7 @@ Cell[BoxData[{ " ", "True", ",", " ", RowBox[{"ParaPrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}]}], "Code",Expressi\ -onUUID->"00492d12-1fbd-46dd-a546-bf4c2c60293b"], +onUUID->"b25f5bae-1d29-46b4-8c4f-1989e748c4a2"], Cell[BoxData[{ RowBox[{ @@ -3592,7 +3590,7 @@ Cell[BoxData[{ " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "eqQ"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"942b1d29-74af-40f0-9f3a-9121c34ca760"], + ";"}]}], "Code",ExpressionUUID->"919a12a0-f34b-4002-bddb-d83358607b30"], Cell[BoxData[{ RowBox[{ @@ -3765,7 +3763,7 @@ Cell[BoxData[{ " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "eqQ"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"4f2fa3d9-be0f-4de8-b4c5-70340b20373c"], + ";"}]}], "Code",ExpressionUUID->"7686d718-2ffe-46a8-aaba-8387ee63643d"], Cell[BoxData[{ RowBox[{ @@ -3841,7 +3839,7 @@ Cell[BoxData[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", RowBox[{"x", "[", "#", "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", "mg"}], ",", " ", "asspay"}], "]"}], "]"}]}], ";"}]}], "Code",Expressio\ -nUUID->"ef2dfb12-0407-459f-983e-c677233c373e"], +nUUID->"9ebd7f77-193c-4c30-8005-7b337b600b91"], Cell[BoxData[ RowBox[{ @@ -3878,8 +3876,8 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"ParaWrongCoordDimension", "[", RowBox[{"coord", ",", " ", "T"}], "]"}]}], "]"}]}], "\n", "]"}]}], - ";"}], "\n"}]}]], "Code",ExpressionUUID->"ab4a2602-3f1c-4168-a468-\ -fe69a5be164e"], + ";"}], "\n"}]}]], "Code",ExpressionUUID->"45cdda2c-28a2-4e6d-8a09-\ +f694d415e8ee"], Cell[BoxData[{ RowBox[{ @@ -4102,7 +4100,7 @@ Cell[BoxData[{ RowBox[{"Apply", "[", RowBox[{"And", ",", " ", RowBox[{"Union", "[", "smarg", "]"}]}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"9c9cd0d1-95e4-4c47-84ae-43de6d02523d"], + ";"}]}], "Code",ExpressionUUID->"f313541b-9fb1-4614-abb5-b6a176de29e3"], Cell[BoxData[{ RowBox[{ @@ -4170,11 +4168,10 @@ Cell[BoxData[{ "\n", " ", RowBox[{"add", " ", "=", " ", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "sumtmg"}], "]"}], " ", "//", " ", - "Simplify"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "sumtmg", "]"}], " ", "//", " ", "Simplify"}]}], + ";", "\n", " ", RowBox[{"NonNegative", "[", "add", "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"4ef9382c-fb29-4e8b-92f8-7508f7d3d246"], + ";"}]}], "Code",ExpressionUUID->"365460df-6ace-4e08-85e6-0f16e77106f9"], Cell[BoxData[ RowBox[{ @@ -4225,7 +4222,7 @@ Cell[BoxData[ "coal"}], "]"}]}], ";", "\n", " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "clsup"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"b43bf211-8ab7-4ecb-bbfb-5cebd3220d98"], + ";"}]}]}]], "Code",ExpressionUUID->"b7b8f60d-103e-4a24-8689-c945f06daf28"], Cell[BoxData[ RowBox[{ @@ -4273,7 +4270,7 @@ Cell[BoxData[ "\n", " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "leq"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}]], "Code",ExpressionUUID->"b7ca6e1f-c1a1-4170-929c-8b7f3550a441"], + ";"}]}]], "Code",ExpressionUUID->"e6f4c21f-4473-4479-97f6-79fffb5ee2ab"], Cell[BoxData[{ RowBox[{ @@ -4345,17 +4342,18 @@ ExcessPayoff[game,payoff]\>\"", "]"}], ";", "\n", " ", "Print", "[", "\"\\"", "]"}]}], "\n", ")"}]}], ";"}]}], "Code",ExpressionUUID->\ -"fb9f4fae-861c-45cf-bf74-f0c290caf021"], +"4d05ebe2-889a-4d50-8838-eededf924b3e"], Cell[BoxData[ RowBox[{ - RowBox[{"SetSharedVariable", "[", "T", "]"}], ";"}]], "Code",ExpressionUUID-\ ->"b01f1856-dd9f-4fb5-b1a7-b54e801c1381"] + RowBox[{"SetSharedVariable", "[", "T", "]"}], ";"}]], "Code",ExpressionUUID->\ +"4560d50d-4400-46a9-ba3b-aa3aa315a2e6"] }, -WindowSize->{630, 827}, -WindowMargins->{{278, Automatic}, {Automatic, 82}}, -FrontEndVersion->"11.3 for Linux x86 (64-bit) (March 6, 2018)", -StyleDefinitions->"Default.nb" +WindowSize->{808, 869}, +WindowMargins->{{144, Automatic}, {91, Automatic}}, +FrontEndVersion->"12.1 for Linux x86 (64-bit) (March 18, 2020)", +StyleDefinitions->"Default.nb", +ExpressionUUID->"309d67a4-479d-40e6-b3a4-028812535ba3" ] (* End of Notebook Content *) @@ -4368,54 +4366,54 @@ CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ -Cell[558, 20, 7923, 177, 1557, "Code",ExpressionUUID->"5a5efd71-9d4e-4597-94a7-3e3071dcc48e"], -Cell[8484, 199, 3140, 67, 936, "Code",ExpressionUUID->"85587713-8b32-467e-9ca0-b36c8ce52aee"], -Cell[11627, 268, 1086, 20, 70, "Code",ExpressionUUID->"b2b2601f-da15-4a69-a1e0-9204b4364084"], -Cell[12716, 290, 290, 6, 70, "Code",ExpressionUUID->"37c4e380-7781-474a-ba7b-a19fb977dc8d"], -Cell[13009, 298, 1865, 42, 70, "Code",ExpressionUUID->"e290da9a-5e78-4a91-9649-f9410a2f996a"], -Cell[14877, 342, 378, 7, 70, "Code",ExpressionUUID->"7a009f3c-f90e-4d78-963e-f0018ff5e80d"], -Cell[15258, 351, 672, 11, 70, "Code",ExpressionUUID->"18644561-a692-4094-a209-dd2badd8488f"], -Cell[15933, 364, 1192, 27, 70, "Code",ExpressionUUID->"09b92d97-2cee-486d-b241-a70c3395d8f2"], -Cell[17128, 393, 4710, 131, 70, "Code",ExpressionUUID->"ecc88007-4327-4eb9-a573-c006260c7a46"], -Cell[21841, 526, 1854, 53, 70, "Code",ExpressionUUID->"a8906218-5a05-4f86-9673-9d161de6a155"], -Cell[23698, 581, 2101, 58, 70, "Code",ExpressionUUID->"e31066a9-47ad-4ae0-a997-edab233f5f25"], -Cell[25802, 641, 357, 10, 70, "Code",ExpressionUUID->"44e27c1a-1ded-4088-a63e-acfde201db6b"], -Cell[26162, 653, 1573, 45, 70, "Code",ExpressionUUID->"e5c9ad9d-d254-43e2-ac3b-db06303d3611"], -Cell[27738, 700, 6665, 163, 70, "Code",ExpressionUUID->"5fae082f-36d2-4a98-88a2-384d92186b8e"], -Cell[34406, 865, 9172, 220, 70, "Code",ExpressionUUID->"cac5c34a-61c8-43fd-88b0-a1f64de251b2"], -Cell[43581, 1087, 7554, 195, 70, "Code",ExpressionUUID->"8ee3fcfd-bd3f-4c1b-b350-bb9d707b2d74"], -Cell[51138, 1284, 3192, 77, 70, "Code",ExpressionUUID->"0ffb7e21-0310-4f96-a5bf-e4aab6f1b7ee"], -Cell[54333, 1363, 3358, 83, 70, "Code",ExpressionUUID->"d0fb24d5-a906-42b5-92d7-21376a7b7564"], -Cell[57694, 1448, 4884, 117, 70, "Code",ExpressionUUID->"4da23308-4fba-43b8-a40b-090c55fcaa31"], -Cell[62581, 1567, 9511, 234, 70, "Code",ExpressionUUID->"df779990-e349-45e8-9ef2-e696a390ff8b"], -Cell[72095, 1803, 3240, 82, 70, "Code",ExpressionUUID->"49e8806d-7511-43a3-b57b-8ab8b5c48069"], -Cell[75338, 1887, 2458, 60, 70, "Code",ExpressionUUID->"2d60fcf1-00bd-4652-a3f7-edb1c66c1eea"], -Cell[77799, 1949, 2427, 58, 70, "Code",ExpressionUUID->"98ac9313-3ada-4030-8eb0-52b75ab3a12d"], -Cell[80229, 2009, 8055, 200, 70, "Code",ExpressionUUID->"69d06600-f78b-47f5-9083-1b0f622c6ed6"], -Cell[88287, 2211, 3850, 94, 70, "Code",ExpressionUUID->"d248f471-15bd-4d16-a8d0-44860bb88273"], -Cell[92140, 2307, 1008, 27, 70, "Code",ExpressionUUID->"3b7149a6-eb3e-4bce-a918-150d618ba805"], -Cell[93151, 2336, 399, 9, 70, "Code",ExpressionUUID->"147f03a3-1829-40da-9c0b-59e30c2c2330"], -Cell[93553, 2347, 3618, 95, 70, "Code",ExpressionUUID->"0309aaad-f856-45a1-a29a-8a44fb62aa1c"], -Cell[97174, 2444, 3997, 98, 70, "Code",ExpressionUUID->"5c469120-5c46-4c7a-a379-5f5adea048a4"], -Cell[101174, 2544, 5086, 126, 70, "Code",ExpressionUUID->"4b9982dd-4e9b-4c06-917a-799ce4271e88"], -Cell[106263, 2672, 3349, 81, 70, "Code",ExpressionUUID->"9a77a759-2d41-4f01-8e2b-2a74acce8efe"], -Cell[109615, 2755, 2731, 74, 70, "Code",ExpressionUUID->"2f1d3338-b2fe-4c74-8faf-42e00792404f"], -Cell[112349, 2831, 4054, 103, 70, "Code",ExpressionUUID->"6620ef8f-9fe2-4cdf-a214-ba90b0f608ea"], -Cell[116406, 2936, 3201, 83, 70, "Code",ExpressionUUID->"850cf05e-6e27-425e-aa79-7acdd335ae69"], -Cell[119610, 3021, 3473, 89, 70, "Code",ExpressionUUID->"12766840-4a6f-4dcb-b971-77f472762f4f"], -Cell[123086, 3112, 4009, 102, 70, "Code",ExpressionUUID->"59e3a928-f6bf-41c8-b33a-52936806457f"], -Cell[127098, 3216, 4390, 107, 70, "Code",ExpressionUUID->"4bf9d0ce-9f98-4420-824b-26380804bc71"], -Cell[131491, 3325, 3912, 96, 70, "Code",ExpressionUUID->"00492d12-1fbd-46dd-a546-bf4c2c60293b"], -Cell[135406, 3423, 6712, 171, 70, "Code",ExpressionUUID->"942b1d29-74af-40f0-9f3a-9121c34ca760"], -Cell[142121, 3596, 6747, 171, 70, "Code",ExpressionUUID->"4f2fa3d9-be0f-4de8-b4c5-70340b20373c"], -Cell[148871, 3769, 2613, 74, 70, "Code",ExpressionUUID->"ef2dfb12-0407-459f-983e-c677233c373e"], -Cell[151487, 3845, 1393, 36, 70, "Code",ExpressionUUID->"ab4a2602-3f1c-4168-a468-fe69a5be164e"], -Cell[152883, 3883, 7857, 221, 70, "Code",ExpressionUUID->"9c9cd0d1-95e4-4c47-84ae-43de6d02523d"], -Cell[160743, 4106, 2679, 70, 70, "Code",ExpressionUUID->"4ef9382c-fb29-4e8b-92f8-7508f7d3d246"], -Cell[163425, 4178, 1926, 49, 70, "Code",ExpressionUUID->"b43bf211-8ab7-4ecb-bbfb-5cebd3220d98"], -Cell[165354, 4229, 1731, 46, 70, "Code",ExpressionUUID->"b7ca6e1f-c1a1-4170-929c-8b7f3550a441"], -Cell[167088, 4277, 2595, 70, 70, "Code",ExpressionUUID->"fb9f4fae-861c-45cf-bf74-f0c290caf021"], -Cell[169686, 4349, 144, 3, 70, "Code",ExpressionUUID->"b01f1856-dd9f-4fb5-b1a7-b54e801c1381"] +Cell[558, 20, 8181, 181, 1512, "Code",ExpressionUUID->"a4c41654-76f8-40ed-9398-df345e77e1de"], +Cell[8742, 203, 3140, 67, 896, "Code",ExpressionUUID->"a5c357a7-4f2e-4219-a69b-f9e7d946b870"], +Cell[11885, 272, 1086, 20, 70, "Code",ExpressionUUID->"4eb1c92a-da3c-4811-a12d-a47d817f65cb"], +Cell[12974, 294, 290, 6, 70, "Code",ExpressionUUID->"a901925c-481d-4bb1-82d0-45bf77da92f6"], +Cell[13267, 302, 1865, 42, 70, "Code",ExpressionUUID->"e89cb5d4-6f5a-4383-8b2c-174b0529ea11"], +Cell[15135, 346, 378, 7, 70, "Code",ExpressionUUID->"0741bdc8-9faa-4eb8-aa21-18f563b8b076"], +Cell[15516, 355, 672, 11, 70, "Code",ExpressionUUID->"849bc064-002a-42d4-9314-f84d2deee6b9"], +Cell[16191, 368, 1192, 27, 70, "Code",ExpressionUUID->"5261b491-2d6b-465a-b889-b8037e68a920"], +Cell[17386, 397, 4710, 131, 70, "Code",ExpressionUUID->"420e451a-e524-433a-988b-f650f2e395b4"], +Cell[22099, 530, 1854, 53, 70, "Code",ExpressionUUID->"12b46d3a-f63b-4a53-9ef9-89706bbf6d50"], +Cell[23956, 585, 2101, 58, 70, "Code",ExpressionUUID->"b0708904-2b36-40f7-b499-1312565f3780"], +Cell[26060, 645, 357, 10, 70, "Code",ExpressionUUID->"62d206eb-1151-4c32-881e-8dd14ce56861"], +Cell[26420, 657, 1573, 45, 70, "Code",ExpressionUUID->"9840ed6c-cf93-46bf-9b09-1927903b403a"], +Cell[27996, 704, 6665, 163, 70, "Code",ExpressionUUID->"16b3684d-77fe-4461-b895-2f8192fbf2db"], +Cell[34664, 869, 9172, 220, 70, "Code",ExpressionUUID->"75b66010-f974-4f48-9d84-6eda86d2212d"], +Cell[43839, 1091, 7501, 193, 70, "Code",ExpressionUUID->"837af7f5-9115-460d-bd67-616469ec9de2"], +Cell[51343, 1286, 3192, 77, 70, "Code",ExpressionUUID->"e02caab1-a38b-44eb-8a02-2753b4400032"], +Cell[54538, 1365, 3358, 83, 70, "Code",ExpressionUUID->"d9792476-c39d-45f2-aac0-bfec0e3b56e9"], +Cell[57899, 1450, 4884, 117, 70, "Code",ExpressionUUID->"43287316-9609-4890-b1c9-dcf81a1351a5"], +Cell[62786, 1569, 9511, 234, 70, "Code",ExpressionUUID->"fb13b87b-0d34-4853-a4d2-8f801303f7c0"], +Cell[72300, 1805, 3240, 82, 70, "Code",ExpressionUUID->"2f0b2290-9069-4861-9420-1fcf629fbe9d"], +Cell[75543, 1889, 2458, 60, 70, "Code",ExpressionUUID->"d1098ab9-dc1e-46cd-b272-68dcfd4ea6be"], +Cell[78004, 1951, 2427, 58, 70, "Code",ExpressionUUID->"483b0c1c-41a5-41c9-b028-388390ff3633"], +Cell[80434, 2011, 8055, 200, 70, "Code",ExpressionUUID->"c1cb2cb0-affe-4481-8bba-466bdffd6830"], +Cell[88492, 2213, 3850, 94, 70, "Code",ExpressionUUID->"06ddd9bf-8fc4-4d0b-9d6c-f963fe342eeb"], +Cell[92345, 2309, 1008, 27, 70, "Code",ExpressionUUID->"fa8d75b9-fdac-4d2b-816e-3fdcfd73c062"], +Cell[93356, 2338, 399, 9, 70, "Code",ExpressionUUID->"fb70a0d0-4fc4-4774-b981-bad53e023c05"], +Cell[93758, 2349, 3618, 95, 70, "Code",ExpressionUUID->"6f6e49b5-afea-42b4-b2f6-4509894b14e7"], +Cell[97379, 2446, 3997, 98, 70, "Code",ExpressionUUID->"994a8927-d933-4131-b778-8f90520dbb6a"], +Cell[101379, 2546, 5086, 126, 70, "Code",ExpressionUUID->"59962d10-2b71-4b6c-95d8-bd30c8869539"], +Cell[106468, 2674, 3349, 81, 70, "Code",ExpressionUUID->"9e6dfd80-e01e-4491-a780-57b7606f37ff"], +Cell[109820, 2757, 2731, 74, 70, "Code",ExpressionUUID->"ebc6f6d7-5315-45ac-8522-68e617b887ee"], +Cell[112554, 2833, 4054, 103, 70, "Code",ExpressionUUID->"ef373b17-04c9-4c99-8cd6-2b889080a060"], +Cell[116611, 2938, 3201, 83, 70, "Code",ExpressionUUID->"e7354b84-3b40-44a6-911e-2976550f4f08"], +Cell[119815, 3023, 3473, 89, 70, "Code",ExpressionUUID->"796e0d42-0be9-4844-8841-a4c2eb5c1469"], +Cell[123291, 3114, 4009, 102, 70, "Code",ExpressionUUID->"5e4f0512-15d6-4794-adc1-783deb0e3360"], +Cell[127303, 3218, 4292, 105, 70, "Code",ExpressionUUID->"c449cad0-cf0a-4ea4-b797-34b1e1e38309"], +Cell[131598, 3325, 3815, 94, 70, "Code",ExpressionUUID->"b25f5bae-1d29-46b4-8c4f-1989e748c4a2"], +Cell[135416, 3421, 6712, 171, 70, "Code",ExpressionUUID->"919a12a0-f34b-4002-bddb-d83358607b30"], +Cell[142131, 3594, 6747, 171, 70, "Code",ExpressionUUID->"7686d718-2ffe-46a8-aaba-8387ee63643d"], +Cell[148881, 3767, 2613, 74, 70, "Code",ExpressionUUID->"9ebd7f77-193c-4c30-8005-7b337b600b91"], +Cell[151497, 3843, 1393, 36, 70, "Code",ExpressionUUID->"45cdda2c-28a2-4e6d-8a09-f694d415e8ee"], +Cell[152893, 3881, 7857, 221, 70, "Code",ExpressionUUID->"f313541b-9fb1-4614-abb5-b6a176de29e3"], +Cell[160753, 4104, 2639, 69, 70, "Code",ExpressionUUID->"365460df-6ace-4e08-85e6-0f16e77106f9"], +Cell[163395, 4175, 1926, 49, 70, "Code",ExpressionUUID->"b7b8f60d-103e-4a24-8689-c945f06daf28"], +Cell[165324, 4226, 1731, 46, 70, "Code",ExpressionUUID->"e6f4c21f-4473-4479-97f6-79fffb5ee2ab"], +Cell[167058, 4274, 2595, 70, 70, "Code",ExpressionUUID->"4d05ebe2-889a-4d50-8838-eededf924b3e"], +Cell[169656, 4346, 144, 3, 70, "Code",ExpressionUUID->"4560d50d-4400-46a9-ba3b-aa3aa315a2e6"] } ] *) diff --git a/ParaTuGames.m b/ParaTuGames.wl similarity index 98% rename from ParaTuGames.m rename to ParaTuGames.wl index 2cc9daa..8b99e39 100644 --- a/ParaTuGames.m +++ b/ParaTuGames.wl @@ -1,8 +1,11 @@ +(* ::Package:: *) + (* :Title: ParaTuGames.m - : Release Date : 28.05.2019 + : Release Date : 21.04.2020 : Preliminary version: For testing only. *) +Off[Needs::nocont] (* :Context: TUG`ParaTuGames` *) (* :Summary: @@ -18,7 +21,7 @@ University of Karlsruhe (KIT) holger.meinhardt@wiwi.uni-karlsruhe.de *) -(* :Package Version: 0.4 *) +(* :Package Version: 0.5 *) (* :Mathematica Version: 8.x, 9.x, 10.x, 11.x, 12.x @@ -343,7 +346,7 @@ bargaining pair (i,j) at a proposal. A plus sign indicates that the arguments ar submex = ParallelMap[{1, -1}.# &, mex]; varpay = x[#] & /@ T; setpay = MapThread[Rule, {varpay, payoff}]; - grmex = v[T] - Apply[Plus, x[#] & /@ T] /. setpay; + grmex = v[T] - Total[x[#] & /@ T] /. setpay; PrependTo[submex, grmex]; If[SameQ[sil,False], Print["submex=", submex],True]; If[SameQ[pinv,False], @@ -764,10 +767,10 @@ bargaining pair (i,j) at a proposal. A plus sign indicates that the arguments ar dimpay = Dimensions[payoff]; tolv=1.5*10^(-8); Which[Length[dimpay] === 2, - Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3),MapThread[And,{(Abs[Apply[Plus, #] - graval]<=tolv) & /@ payoff,ParaMaxExcessBalanced[game, payoff]}], + Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3),MapThread[And,{(Abs[Total[#] - graval]<=tolv) & /@ payoff,ParaMaxExcessBalanced[game, payoff]}], True, ParaPrintRemark[payoff]], Length[dimpay] === 1, - Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Apply[Plus, payoff] - graval]<=tolv},{ParaMaxExcessBalanced[game, payoff]}}], + Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Total[payoff] - graval]<=tolv},{ParaMaxExcessBalanced[game, payoff]}}], True, ParaPrintRemark[payoff]], True, ParaPrintRemark[payoff] ] @@ -780,10 +783,10 @@ bargaining pair (i,j) at a proposal. A plus sign indicates that the arguments ar dimpay = Dimensions[payoff]; tolv=1.5*10^(-7); Which[Length[dimpay] === 2, - Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3), MapThread[And,{(Abs[Apply[Plus, #] - graval]<= tolv) & /@ payoff,ParaMinExcessBalanced[game, payoff]}], + Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3), MapThread[And,{(Abs[Total[#] - graval]<= tolv) & /@ payoff,ParaMinExcessBalanced[game, payoff]}], True, ParaPrintRemark[payoff]], Length[dimpay] === 1, - Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Apply[Plus, payoff] - graval]<=tolv},{ParaMinExcessBalanced[game, payoff]}}], + Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Total[payoff] - graval]<=tolv},{ParaMinExcessBalanced[game, payoff]}}], True, ParaPrintRemark[payoff]], True, ParaPrintRemark[payoff] ] @@ -936,7 +939,7 @@ bargaining pair (i,j) at a proposal. A plus sign indicates that the arguments ar delisp = DeleteCases[superset, #] & /@ teilmg; delitlm = DeleteCases[teilmg, #] & /@ teilmg; sumtmg = MapThread[(v[superset] - v[#1] - v[teilmg] + v[#2]) &, {delisp, delitlm}]; - add = Apply[Plus, sumtmg] // Simplify; + add = Total[sumtmg] // Simplify; NonNegative[add] ]; diff --git a/README b/README index e99f020..082ffe4 100644 --- a/README +++ b/README @@ -103,21 +103,52 @@ We have provided some executables for RHEL 7.5 and MacOSX. Unfortunately, we are experienced enough under Windows to provide any for those. Thus, we invite the community to fill that gap and to provide some. -In order check the paths where you have to install the Cddmathlink library call + +In order check for Mathematica versions smaller than 12.1 the paths where you have to install the Cddmathlink library call the command + In[1]:= PacletInformation["TUG"] -Out[1]= {Name -> TUG, Version -> 2.5.4, BuildNumber -> , Qualifier -> , WolframVersion -> 10+, +Out[1]= {Name -> TUG, Version -> 2.6.0, BuildNumber -> , Qualifier -> , WolframVersion -> 10+, SystemID -> All, Description -> A Mathematica Package for Cooperative Game Theory, Category -> , Creator -> Holger Ingmar Meinhardt , - Publisher -> , Support -> , Internal -> False, Location -> /home/kit/xxx/xxxx/.Mathematica/Paclets/Repository/TUG-2.5.4 + Publisher -> , Support -> , Internal -> False, Location -> /home/kit/xxx/xxxx/.Mathematica/Paclets/Repository/TUG-2.6.0 Context -> {TUG`coop`, TUG`vertex`, TUG`}, Enabled -> True, Loading -> Manual} -Then open the directory. + +To get the same information and beyond that under Mathematica version 12.1, it is required to execute + + +In[1]:= PacletObject["TUG"][All] + + +Out[1]= {"Name" -> "TUG", "Version" -> "2.6.0", "WolframVersion" -> "10+", + "Qualifier" -> "", "SystemID" -> All, "Description" -> "A Mathematica Package for Cooperative Game Theory", + "Category" -> Missing["NotAvailable"], "Keywords" -> Missing["NotAvailable"], + "UUID" -> Missing["NotAvailable"], + "Creator" -> + "Holger Ingmar Meinhardt ", + "URL" -> "https://github.com/himeinhardt/TuGames", + "Internal" -> False, + "Context" -> {"TUG`coop`", "TUG`vertex`", "TUG`"}, + "Loading" -> Manual, "AutoUpdating" -> False, "Enabled" -> True, + "Location" -> "/home/kit/xxx/xxxx/.Mathematica/Paclets/Repository/TUG-2.6.0"} + +or alternatively + +Information[PacletObject["TUG"]] + +Then open the directory for Mathematica versions smaller than 12.1 by SystemOpen@Lookup[PacletInformation["TUG"], "Location"] +or for Mathematica version 12.1 one opens the directory via + + +SystemOpen@Lookup[PacletObject["TUG"][All], "Location"] + + This returns the root directory of TUG, and shows you the three folders cddmathlink, cddmathlink2 and cddmathlink2gmp that should receive the Cddmathlink executables. @@ -139,17 +170,33 @@ operating system that can be found from the Mathematica documentation. Start Mathematica, open a notebook, and execute therein -PacletInstall["/full/Path/to/TUG-2.5.4.paclet"] +PacletInstall["/full/Path/to/TUG-2.6.0.paclet"] that should return the value -Paclet[TUG, 2.5.4, <>] +Paclet[TUG, 2.6.0, <>] to indicate a successful installation. Notice that -"/full/Path/to/TUG-2.5.4.paclet" +"/full/Path/to/TUG-2.6.0.paclet" + +indicates the directory where the TUG-2.6.0.paclet is located at your hard-disk. + +Alternatively, one can directly install the package from GitHub with the help of the Mathematica-Tools from + +https://github.com/b3m2a1/mathematica-tools + +For doing so, install first the package paclet generator and installer while executing within a running Mathematica session the command + + +Get["https://raw.githubusercontent.com/b3m2a1/mathematica-tools/master/PackageDataPacletInstall.m"] + + +After that, the current version of TuGames can be installed while calling from your notebook + + +PDInstallPaclet["https://github.com/himeinhardt/TuGames"] -indicates the directory where the TUG-2.5.4.paclet is located at your hard-disk. In order to use the graphical features of the package, it is recommended to install the Cddmathlink executables in pre-defined folders as described in Section 1. This C-library must be compiled by yourself if the shipped @@ -184,7 +231,7 @@ In[2]:= Needs["TUG`"] =================================================== Loading Package 'TuGames' for Unix =================================================== -TuGames V2.5.4 by Holger I. Meinhardt +TuGames V2.6.0 by Holger I. Meinhardt Release Date: 26.05.2019 Program runs under Mathematica Version 8.0 or later Version 8.x or higher is recommended diff --git a/README.md b/README.md index 6087721..a5c6c9d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# *Mathematica* Package: *TuGames* Version 2.5.4 +# *Mathematica* Package: *TuGames* Version 2.6.0 ``` Contents: @@ -23,7 +23,7 @@ game properties of transferable utility games. It provides more than 200 different functions to calculate, for instance, (pre-)kernel elements, the (pre-)nucleolus, the modiclus, the modified and proper modified pre-kernel, the Shapley value, Lorenz solution, Dutta-Ray solution, -excess payoffs, the tau-value, the vertices of a core, and much more. +excess payoffs, the tau-value, chi-value, Gately point, the vertices of a core, and much more. Moreover, it verifies if the game is convex, average-convex or superadditive just to mention some interesting game properties. It can be used in serial as well as in parallel mode, and in conjunction with *MATLink* to build up a *Matlab* @@ -116,25 +116,56 @@ We have provided some executables for *RHEL 7.5* and *MacOSX*. Unfortunately, we experienced enough under *Windows* to provide any for those. Thus, we invite the community to fill that gap and to provide some. -In order check the paths where you have to install the Cddmathlink library call +In order check for *Mathematica* versions smaller than 12.1 the paths where you have to install the Cddmathlink library call the command ``` In[1]:= PacletInformation["TUG"] -Out[1]= {Name -> TUG, Version -> 2.5.4, BuildNumber -> , Qualifier -> , WolframVersion -> 10+, +Out[1]= {Name -> TUG, Version -> 2.6.0, BuildNumber -> , Qualifier -> , WolframVersion -> 10+, SystemID -> All, Description -> A Mathematica Package for Cooperative Game Theory, Category -> , Creator -> Holger Ingmar Meinhardt , - Publisher -> , Support -> , Internal -> False, Location -> /home/kit/xxx/xxxx/.Mathematica/Paclets/Repository/TUG-2.5.4 + Publisher -> , Support -> , Internal -> False, Location -> /home/kit/xxx/xxxx/.Mathematica/Paclets/Repository/TUG-2.6.0 Context -> {TUG`coop`, TUG`vertex`, TUG`}, Enabled -> True, Loading -> Manual} ``` -Then open the directory. +To get the same information and beyond that under *Mathematica* version 12.1, it is required to execute + +``` +In[1]:= PacletObject["TUG"][All] +``` +``` +Out[1]= {"Name" -> "TUG", "Version" -> "2.6.0", "WolframVersion" -> "10+", + "Qualifier" -> "", "SystemID" -> All, "Description" -> "A Mathematica Package for Cooperative Game Theory", + "Category" -> Missing["NotAvailable"], "Keywords" -> Missing["NotAvailable"], + "UUID" -> Missing["NotAvailable"], + "Creator" -> + "Holger Ingmar Meinhardt ", + "URL" -> "https://github.com/himeinhardt/TuGames", + "Internal" -> False, + "Context" -> {"TUG`coop`", "TUG`vertex`", "TUG`"}, + "Loading" -> Manual, "AutoUpdating" -> False, "Enabled" -> True, + "Location" -> "/home/kit/xxx/xxxx/.Mathematica/Paclets/Repository/TUG-2.6.0"} +``` +or alternatively + +``` +Information[PacletObject["TUG"]] +``` + + +Then open the directory for *Mathematica* versions smaller than 12.1 by ``` SystemOpen@Lookup[PacletInformation["TUG"], "Location"] ``` +or for *Mathematica* version 12.1 one opens the directory via + +``` +SystemOpen@Lookup[PacletObject["TUG"][All], "Location"] +``` + This returns the root directory of `TUG`, and shows you the three folders `cddmathlink, cddmathlink2` and `cddmathlink2gmp` that should receive the Cddmathlink executables. @@ -157,22 +188,38 @@ operating system that can be found from the Mathematica documentation. Start Mathematica, open a notebook, and execute therein ``` -PacletInstall["/full/Path/to/TUG-2.5.4.paclet"] +PacletInstall["/full/Path/to/TUG-2.6.0.paclet"] ``` that should return the value ``` -Paclet[TUG, 2.5.4, <>] +Paclet[TUG, 2.6.0, <>] ``` to indicate a successful installation. Notice that ``` -"/full/Path/to/TUG-2.5.4.paclet" +"/full/Path/to/TUG-2.6.0.paclet" +``` + +indicates the directory where the `TUG-2.6.0.paclet` is located at your hard-disk. + +Alternatively, one can directly install the package from GitHub with the help of the *Mathematica-Tools* from + +[Mma Tools](https://github.com/b3m2a1/mathematica-tools) + +For doing so, install first the package paclet generator and installer while executing within a running *Mathematica* session the command + +``` +Get["https://raw.githubusercontent.com/b3m2a1/mathematica-tools/master/PackageDataPacletInstall.m"] +``` +After that, the current version of TuGames can be installed while calling from your notebook + +``` +PDInstallPaclet["https://github.com/himeinhardt/TuGames"] ``` -indicates the directory where the `TUG-2.5.4.paclet` is located at your hard-disk. In order to use the graphical features of the package, it is recommended to install the Cddmathlink executables in pre-defined folders as described in Section 1. This C-library must be compiled by yourself if the shipped @@ -213,8 +260,8 @@ In[2]:= Needs["TUG`"] =================================================== Loading Package 'TuGames' for Unix =================================================== -TuGames V2.5.4 by Holger I. Meinhardt -Release Date: 26.05.2019 +TuGames V2.6.0 by Holger I. Meinhardt +Release Date: 22.04.2020 Program runs under Mathematica Version 8.0 or later Version 8.x or higher is recommended =================================================== @@ -452,7 +499,8 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) f ## Author -*Holger I. Meinhardt* +** Holger I. Meinhardt ** Institute of Operations Research University of Karlsruhe (KIT) E-mail: Holger.Meinhardt ät wiwi.uni-karlsruhe.de + holger.meinhardt ät partner.kit.edu diff --git a/TuGames.nb b/TuGames.nb index 9ffe1f7..fd3ee2e 100644 --- a/TuGames.nb +++ b/TuGames.nb @@ -3,17 +3,17 @@ (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) -(* CreatedBy='Mathematica 11.3' *) +(* CreatedBy='Mathematica 12.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] -NotebookDataLength[ 1053254, 26412] -NotebookOptionsPosition[ 1033680, 26202] -NotebookOutlinePosition[ 1034015, 26217] -CellTagsIndexPosition[ 1033972, 26214] +NotebookDataLength[ 1101267, 27654] +NotebookOptionsPosition[ 1081403, 27441] +NotebookOutlinePosition[ 1081795, 27457] +CellTagsIndexPosition[ 1081752, 27454] WindowFrame->Normal*) (* Beginning of Notebook Content *) @@ -56,7 +56,7 @@ Cell[BoxData[ RowBox[{"(*", " ", RowBox[{":", RowBox[{"Package", " ", "Version"}], ":", " ", - RowBox[{"2.5", ".4"}]}], " ", "*)"}], "\n", "\n", + RowBox[{"2.6", ".0"}]}], " ", "*)"}], "\n", "\n", RowBox[{"(*", " ", "\n", " ", RowBox[{ RowBox[{":", @@ -137,10 +137,22 @@ Cell[BoxData[ RowBox[{"Excesses", "."}]}]}], "\n", "*)"}], "\n", "\n", RowBox[{"(*", " ", RowBox[{ - RowBox[{":", "Sources", ":", "\n", " ", "\n", " ", + RowBox[{ RowBox[{ - "Chih", " ", "Chang", " ", "and", " ", "Theo", " ", "Driessen"}]}], ",", - " ", + RowBox[{":", "Sources", ":", "\n", " ", + RowBox[{"G", ".", " ", "Bergantinos"}]}], " ", "&"}], " ", + RowBox[{"J", ".", " ", "Masso"}]}], ",", " ", + RowBox[{"Notes", " ", "on", " ", "a", " ", "new", " ", "compromise", " ", + RowBox[{"value", ":", " ", + RowBox[{ + RowBox[{"The", " ", "Chi"}], "-", "Value"}]}]}], ",", "\n", " ", + RowBox[{"Optimization", " ", "1996"}], ",", " ", + RowBox[{"Vol", ".", " ", "38"}], ",", " ", + RowBox[{ + RowBox[{"pp", ".", " ", "277"}], "-", + RowBox[{ + "286.", "\n", " ", "\n", " ", "Chih", " ", "Chang", " ", "and", " ", + "Theo", " ", "Driessen"}]}], ",", " ", RowBox[{ RowBox[{"(", "Pre", ")"}], "Kernel", " ", "Catchers", " ", "for", " ", "Cooperative", " ", "Games"}], ",", "\n", " ", @@ -275,7 +287,47 @@ Cell[BoxData[ RowBox[{"Game", ".", " ", "Taiwanese"}], " ", "Journal", " ", "of", " ", "Mathematics"}], ",", " ", RowBox[{"12", ":", "1581"}], "\[Dash]", "1590", ",", " ", - RowBox[{"2008.", "\n", "\n", " ", + RowBox[{ + RowBox[{"2008.", "\n", "\n", " ", + RowBox[{"M", ".", " ", "Leng"}], " ", "and", " ", + RowBox[{"M", ".", " ", "Parlar", ".", " ", "Analytic"}], " ", + "solution", " ", "for", " ", "the", " ", "nucleolus", " ", "of", " ", + "a", " ", "three"}], "-", + RowBox[{"player", " ", "cooperative", "\n", " ", + RowBox[{"game", ".", " ", "Naval"}], " ", "Research", " ", "Logistics", + " ", + RowBox[{"(", "NRL", ")"}]}]}], ",", " ", + RowBox[{ + RowBox[{"57", + RowBox[{"(", "7", ")"}]}], ":", "667"}], "\[Dash]", "672", ",", " ", + RowBox[{ + RowBox[{"2010.", " ", + RowBox[{"doi", ":", " ", + RowBox[{ + RowBox[{"10.1002", "/", "nav"}], + RowBox[{".20429", ".", "\n", " ", "URL"}], " ", "https"}], ":"}]}], + "//", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"onlinelibrary", ".", "wiley", ".", "com"}], "/", "doi"}], + "/", "abs"}], "/", "10.1002"}], "/", "nav"}], + RowBox[{ + ".20429", ".", "\n", "\n", " ", "SC", ".", " ", "Littlechild"}], " ", + "and", " ", + RowBox[{"KG", ".", " ", "Vaidya"}]}]}], ",", " ", + RowBox[{ + RowBox[{ + "The", " ", "propensity", " ", "to", " ", "disrupt", " ", "and", " ", + "the", " ", "disruption", " ", "nucleolus", "\n", " ", "of", " ", + "a", " ", "characteristic", " ", "function", " ", + RowBox[{"game", ".", " ", "International"}], " ", "Journal", " ", "of", + " ", "Game", " ", "Theory", " ", "5", + RowBox[{"(", "2", ")"}]}], ":", + RowBox[{"151", "-", "161"}]}], ",", "\n", " ", + RowBox[{"1976.", "\n", "\n", " ", RowBox[{"M", ".", " ", "Maschler"}]}], ",", " ", RowBox[{"The", " ", "Bargaining", " ", "Set"}], ",", " ", RowBox[{"Kernel", " ", "and", " ", "Nucleolus"}], ",", " ", @@ -495,8 +547,8 @@ Cell[BoxData[ RowBox[{"Ed", "."}], ")"}], ".", " ", "Economics"}], " ", "and", " ", "Financial", " ", "Modeling", " ", "with", " ", "Mathematica"}]}], ",", " ", "\n", " ", "Springer", ",", " ", "1992."}], " ", "\n", - "*)"}]}]}]], "Code",ExpressionUUID->"f51a3729-20b7-447d-9c9b-\ -e163a4ff310c"], + "*)"}]}]}]], "Code",ExpressionUUID->"9a8aeddf-de48-46c5-8fd3-\ +783ac9b2ee66"], Cell[BoxData[ RowBox[{"(*", " ", "\n", " ", @@ -774,8 +826,31 @@ Cell[BoxData[ RowBox[{ RowBox[{"for", " ", "n"}], "=", RowBox[{ - "6", " ", "we", " ", "have", " ", "to", " ", "check", " ", "158", " ", - RowBox[{"classes", "."}]}]}]}], "\n", "\n", "*)"}]], "Code",ExpressionUUID->"a0016576-4667-4d02-bc22-a7645518f109"], + RowBox[{ + "6", " ", "we", " ", "have", " ", "to", " ", "check", " ", "158", " ", + RowBox[{"classes", ".", "\n", "\n", " ", "Version"}], " ", "2.6", + ".0"}], ":", "\n", " ", + RowBox[{ + RowBox[{ + "Adding", " ", "functions", " ", "to", " ", "compute", " ", "the", " ", + "EPSD"}], "-", "Value"}]}]}], ",", " ", + RowBox[{"Chi", "-", "Value"}], ",", " ", + RowBox[{"PD", "-", + RowBox[{ + "Value", " ", "and", " ", "the", " ", "nucleolus", " ", "by", " ", "the", + " ", "Leng", " ", "and", " ", "Parlar", " ", + RowBox[{"(", "2010", ")"}], " ", "formulae", " ", "for", " ", "three", + " ", "person", "\n", " ", "zero"}], "-", + RowBox[{"normalized", " ", "and", " ", "super"}], "-", + RowBox[{"additive", " ", + RowBox[{"games", ".", " ", "Changing"}], " ", "the", " ", "package", " ", + "extension", " ", "from", " ", "*", + RowBox[{".", "m"}], " ", "to", " ", "*", + RowBox[{".", "wl", ".", "\n", "\n", " ", "Performing"}], " ", + "some", " ", "code", " ", "maintenance", " ", "and", " ", "minor", " ", + "bug", " ", + RowBox[{"fixes", "."}]}]}]}], "\n", "\n", "*)"}]], "Code",ExpressionUUID->\ +"ee731aa3-8b1e-4e3d-b8b7-1441a0d9c95c"], Cell[BoxData[ RowBox[{"(*", " ", "\n", " ", @@ -785,7 +860,7 @@ Cell[BoxData[ RowBox[{"TUG", "/", "Guides"}], "/", "ManualTuGames"}], " ", "from", " ", "the", " ", "Documentation", " ", RowBox[{"Center", "."}]}]}], " ", "\n", "*)"}]], "Code",ExpressionUUID->\ -"5b24a71e-66bf-44ef-90c4-b6e61c261887"], +"0a942dd6-73d8-4f51-a78a-18dbeb0b9973"], Cell[BoxData[ RowBox[{ @@ -798,7 +873,7 @@ Cell[BoxData[ "this", " ", "project", " ", "is", " ", "licensed", " ", "under", " ", "the", " ", "MIT", " ", "License", " ", RowBox[{"terms", "."}]}]}], "\n", " ", "\n", "*)"}], "\n"}]], "Code",E\ -xpressionUUID->"df105406-21af-4231-a185-e20c73eeaf20"], +xpressionUUID->"66d67f11-4f56-4435-8b94-78f024347417"], Cell[BoxData[ RowBox[{ @@ -873,7 +948,7 @@ Cell[BoxData[ "state", " ", "of", " ", "Baden"}], "-", RowBox[{"W\[UDoubleDot]rttemberg", " ", "through", " ", RowBox[{"bwHPC", "."}]}]}]}], "\n", "*)"}], " "}]], "Code",ExpressionU\ -UID->"821132e2-f8bf-4c64-bdd3-113793d51d95"], +UID->"1fb796d8-104f-432f-81e9-6abdd691b6c4"], Cell[BoxData[{ RowBox[{ @@ -904,9 +979,9 @@ Cell[BoxData[{ "\"\<===================================================\>\"", "]"}], ";", "\n", RowBox[{ - "Print", "[", "\"\\"", "]"}], + "Print", "[", "\"\\"", "]"}], ";", "\n", - RowBox[{"Print", "[", "\"\\"", "]"}], ";", + RowBox[{"Print", "[", "\"\\"", "]"}], ";", "\n", RowBox[{ "Print", "[", @@ -932,7 +1007,7 @@ Cell[BoxData[{ analyzed. T is the player set and values are the worth for the coalitions.\n \ Do not forget the semicolons, otherwise some compatibly problems with\n M. \ Carter's ShapleyValue[] occurs\>\""}], ";"}]}], "Code",ExpressionUUID->\ -"c6405b2f-f0c4-4fa6-bf8b-d6858178c6e6"], +"fe18ee2c-6e92-4fc1-9b47-c835f26a7275"], Cell[BoxData[{ RowBox[{ @@ -1016,7 +1091,7 @@ returns only 'True' or 'False'.\>\""}], ";"}], "\n"}], "\n", It returns 'True' or 'False'. Calling the function with the option will \ return\n the sum of the marginal contributions for each coalition S w.r.t. to \ each \n superset S union {j}. These values must be non-negative.\>\""}], - ";"}]}], "Code",ExpressionUUID->"e9f5eb75-07a2-448c-9c13-b8343724d2bc"], + ";"}]}], "Code",ExpressionUUID->"4a812198-4103-4011-bd95-37fb03e48b65"], Cell[BoxData[ RowBox[{ @@ -1026,7 +1101,7 @@ Cell[BoxData[ "\"\\""}], ";"}], - " "}]], "Code",ExpressionUUID->"92406f57-701f-4307-889d-ffafbc9e966d"], + " "}]], "Code",ExpressionUUID->"12893285-1219-41d4-afda-f0f777ed6b1d"], Cell[BoxData[{ RowBox[{ @@ -1093,8 +1168,8 @@ See Funaki (1986).\>\""}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{"TIJsets", "::", "usage"}], " ", "=", " ", "\n", "\"\\""}], ";"}]}], "Code",ExpressionUUID->"0bb67874-1207-4915-87eb-\ -99cc7d33d0ef"], +j.\>\""}], ";"}]}], "Code",ExpressionUUID->"98322137-aae4-4870-9cbc-\ +8c62b00dd9e4"], Cell[BoxData[{ RowBox[{ @@ -1186,7 +1261,7 @@ core.\n That means, a vertex of the kernel solution inside of the least core \ will be computed.\n Thus, in many cases the Nucleolus should be computed. The \ algorithm is based \n on a method by Peleg to translate the definition of the \ Nucleolus into \n a sequence of linear programs.\>\""}], ";"}]}], "Code",Expre\ -ssionUUID->"ab69e5f9-3599-4f3d-b0ac-c3e344cfcbec"], +ssionUUID->"86c1efba-f1eb-41e7-a009-a06d3d919ecb"], Cell[BoxData[ RowBox[{ @@ -1197,7 +1272,7 @@ core.\n The algorithm is based on a method by Peleg to translate the \ definition of the \n Nucleolus into a sequence of linear programs. The \ recursion stops, if the set\n of new equal constraints is empty. A simplex \ method is now used to \n increase its computational reliability.\>\""}], - ";"}]], "Code",ExpressionUUID->"31f398ee-4043-48f0-87e6-c761ed1f62eb"], + ";"}]], "Code",ExpressionUUID->"83d0b6da-e68e-4bb8-87f5-9b37d4c27963"], Cell[BoxData[{ RowBox[{ @@ -1259,6 +1334,17 @@ then it computes the least square nucleolus.\>\""}], ";"}], "\n"}], "\n", RowBox[{"ModCoalArray", "::", "usage"}], " ", "=", "\n", "\"\\""}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"StandardSolution", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"NucleolusThreePerson", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{ @@ -1277,8 +1363,8 @@ original game. Do not confound this command\n with the function \ ModfiedNucleolus[]. The algorithm is based on a method by Peleg to translate\n\ the definition of the Nucleolus into a sequence of linear programs on the \ pre-imputation set.\n A simplex method is now used to increase its \ -computational reliability.\>\""}], ";"}]}], "Code",ExpressionUUID->"e5c9d6a8-\ -329d-4fc7-8d05-2a93c8dbec57"], +computational reliability.\>\""}], ";"}]}], "Code",ExpressionUUID->"874de4c3-\ +bd12-4792-aadc-c1816792c836"], Cell[BoxData[{ RowBox[{ @@ -1398,7 +1484,7 @@ otherwise 'False'.\>\""}], ";"}], "\n"}], "\n", "\"\\""}], ";"}]}], "Code",ExpressionUUID->\ -"45f36900-a18f-40a7-ac4f-81571d206f4c"], +"e262b8da-76f9-4d39-aacf-7a7130034ede"], Cell[BoxData[{ RowBox[{ @@ -1512,7 +1598,7 @@ This information can be obtained by invoking the option InFavor. Notice that \ \n whenever the option EffVector is set to 'True', then the first vector must \ be positive, since it is \n related to the grand coalition. Similar to \ SetsToVec[]. See also SetsToVec[].\>\""}], ";"}]}], "Code",ExpressionUUID->\ -"946452c8-7adc-4dcb-9f41-7403b4ed54c0"], +"384b8100-b0ed-44fc-9129-488f728bdefe"], Cell[BoxData[{ RowBox[{ @@ -1537,8 +1623,8 @@ the function BargainUnanMatrix[game,payoff,EffVector -> False].\>\""}], ";"}], "\"\\""}], ";"}]}], "Code",ExpressionUUID->"b87b37ba-ddca-48fb-acd5-\ -279e37a6f97d"], +(2013).\>\""}], ";"}]}], "Code",ExpressionUUID->"56be4b08-2581-4758-9ad8-\ +dd98dbc3c0bf"], Cell[BoxData[ RowBox[{ @@ -1547,7 +1633,7 @@ Cell[BoxData[ "\"\\""}], ";"}]], "Code",Expressio\ -nUUID->"3b4cc372-2400-4791-9eeb-aed69c911002"], +nUUID->"a13b99f1-434d-45c2-95e7-4f3406f13959"], Cell[BoxData[{ RowBox[{ @@ -1584,7 +1670,7 @@ improvement in order reduce \n the maximum surpluses.\>\""}], ";"}], solution by iteratively carrying \n out transfers between pairs of players. \ The suggested algorithm is due to M. Maschler. For details \n see U. Faigle, \ W. Kern and J. Kuipers (1998).\>\""}], ";"}]}], "Code",ExpressionUUID->\ -"6325a953-27bf-4f72-9e3b-b83799b704d5"], +"ea04aedd-1f1c-426a-833d-95cb51bcb65a"], Cell[BoxData[ RowBox[{ @@ -1594,7 +1680,7 @@ Cell[BoxData[ solution by iteratively carrying \n out transfers between pairs of players. \ The suggested algorithm is due to M. Maschler. For details \n see U. Faigle, \ W. Kern and J. Kuipers (1998).\>\""}], ";"}]], "Code",ExpressionUUID->\ -"650828de-dfc8-4cdf-a266-dacd7bc05804"], +"45fa5cf6-5820-47b1-9a6f-39e50692ff18"], Cell[BoxData[{ RowBox[{ @@ -1681,7 +1767,7 @@ checked.\>\""}], ";"}], "\n"}], "\n", "\"\\""}], ";"}]}], "Code",ExpressionUU\ -ID->"3a9f8058-0dab-4fb7-a987-14921695cc53"], +ID->"db668b20-cafe-4c5c-b7cd-791a9dc3f4cc"], Cell[BoxData[{ RowBox[{ @@ -2020,6 +2106,24 @@ coalition S.\>\""}], ";"}], "\n"}], "\n", RowBox[{"Gap", "::", "usage"}], " ", "=", " ", "\n", "\"\\""}], ";"}], " ", "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenGap", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], ";"}], " ", "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenUpperVector", "::", "usage"}], " ", "=", "\n", " ", + "\"\\""}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenUpperSum", "::", "usage"}], " ", "=", "\n", " ", + "\"\\""}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{ @@ -2065,6 +2169,39 @@ game.\>\""}], ";"}], "\n"}], "\n", "\"\\""}], ";"}], " ", "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"ChiValue", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GatelyValue", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"PDValue", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"EPSDValue", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], ";"}], + "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenConcession", "::", "usage"}], " ", "=", " ", "\n", + "\"\\""}], ";"}], + "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{ @@ -2095,7 +2232,7 @@ allocations. An imputation x \n is in the core iff x =< dual v.\>\""}], ";"}], "\"\\""}]}], \ -"Code",ExpressionUUID->"bd119c4c-4da1-411e-b95d-952bb8e5484c"], +"Code",ExpressionUUID->"6a490d82-c3be-4fe8-8fab-8246b0a22995"], Cell[BoxData[{ RowBox[{ @@ -2149,8 +2286,8 @@ coordinate for each coalition size.\>\""}], ";"}], "\n"}], "\n", inequalities of the unanimity coordinates \n constraints for strict positive \ sums. It examines if the sufficient condition of convexity in terms \n of \ unanimity coordinates is satisfied. The return value is 'True' or 'False'. \ -See also EvalSumMinCoord[].\>\""}], ";"}]}], "Code",ExpressionUUID->"513fba80-\ -9a03-495c-994c-b3a12cda3e30"], +See also EvalSumMinCoord[].\>\""}], ";"}]}], "Code",ExpressionUUID->"6b61ae3a-\ +813c-4b4b-8e40-5a6fd9c67d31"], Cell[BoxData[ RowBox[{ @@ -2161,8 +2298,8 @@ Cell[BoxData[ unanimity coordinates constraints \n for positive sums. It examines if the \ sufficient condition of convexity in terms of unanimity \n coordinates is \ satisfied. The return value is 'True' or 'False'. See also EvalSumMinCoord[].\ -\>\""}], ";"}], " "}]], "Code",ExpressionUUID->"27628b26-13ca-41f6-961f-\ -c3c3dc0acf5e"], +\>\""}], ";"}], " "}]], "Code",ExpressionUUID->"6701ecd9-517f-47e0-ad49-\ +beef46504a17"], Cell[BoxData[{ RowBox[{ @@ -2180,8 +2317,8 @@ on the results, all terms must be non-negative.\>\""}], ";"}], "\n"}], "\n", sufficient and necessary condition \n of average convexity of the game in \ terms of unanimity coordinates. Calling the function with its options\n open \ a glance on the results, all terms must be non-negative. See Solano and \ -Rafels (1996).\>\""}], ";"}]}], "Code",ExpressionUUID->"c3f6e179-f093-4d82-\ -ac57-a16646ba8c28"], +Rafels (1996).\>\""}], ";"}]}], "Code",ExpressionUUID->"3802b4f0-eb3f-4401-\ +95d8-217a20687ec6"], Cell[BoxData[{ RowBox[{ @@ -2226,8 +2363,8 @@ non-negative vector [q; p1, ..., pt], \n where T={1,...t}=Range[t]. It is \ admissible to specify the vector of weights by the following \n format of \ lists {q, p1, ...,pt} or {q, {p1, ..., pt}} or {{q}, {p1, ...,pt}}. The \ resultant list can \n then be used to define a game by using the function \ -DefineGame[].\>\""}], ";"}]}], "Code",ExpressionUUID->"d76873cd-d9a7-47c5-\ -9c7c-8fd9e45950c5"], +DefineGame[].\>\""}], ";"}]}], "Code",ExpressionUUID->"9940d43a-620f-44e7-\ +8919-e22d68a91561"], Cell[BoxData[ RowBox[{ @@ -2342,7 +2479,7 @@ segment of the (pre)-kernel.\>\""}], ";"}], "\n", "\n", is a kernel catcher.\n This function may useful in connection with the \ package 'TuGamesView3D' to visualize for \n four person games the upper set. \ This set can coincide with the reasonable set.\>\""}], ";"}]}]}]], "Code",Expr\ -essionUUID->"0e364f94-fcf0-4cd8-b360-b74d45bead28"], +essionUUID->"d74e86ee-5234-4aab-8768-d85dce2e7153"], Cell[BoxData[ RowBox[{ @@ -3137,7 +3274,7 @@ Cell[BoxData[ RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "12"}], ")"}]}]}]}], "}"}]}], ";"}]}], "\n", "]"}], - ";"}]], "Code",ExpressionUUID->"82fad4f9-a56c-4299-bbce-32d2e514edb5"], + ";"}]], "Code",ExpressionUUID->"ccd3fe48-9af4-4983-8b11-06963a82487e"], Cell[BoxData[ RowBox[{ @@ -3212,6 +3349,10 @@ Cell[BoxData[ RowBox[{ RowBox[{"CddVerticesReasonableSet", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"ChiValue", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"Concession", "::", "argerr"}], "=", @@ -3268,6 +3409,10 @@ Cell[BoxData[ RowBox[{ RowBox[{"EpsCore", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"EPSDValue", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"EvalSumMinCoord", "::", "argerr"}], "=", @@ -3308,6 +3453,26 @@ Cell[BoxData[ RowBox[{ RowBox[{"Gap", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GatelyValue", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenConcession", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenUpperPayoff", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenUpperSum", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenUpperVector", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"GrandCoalitionLargestValueQ", "::", "argerr"}], "=", @@ -3395,6 +3560,10 @@ Cell[BoxData[ RowBox[{ RowBox[{"NewShapley", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"NucleolusThreePerson", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"Nuc1convex", "::", "argerr"}], "=", @@ -3403,6 +3572,10 @@ Cell[BoxData[ RowBox[{ RowBox[{"OneNormalization", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"PDValue", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"PlayerPairs", "::", "argerr"}], "=", @@ -3455,6 +3628,10 @@ Cell[BoxData[ RowBox[{ RowBox[{"ReasonableSet", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"StandardSolution", "::", "argerr"}], "=", + "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"ScrbSolution", "::", "argerr"}], "=", @@ -3555,10 +3732,6 @@ Cell[BoxData[ RowBox[{ RowBox[{"UpperSetQ", "::", "argerr"}], "=", "\"\\""}], ";"}], "\n", - RowBox[{ - RowBox[{ - RowBox[{"UpperVector", "::", "argerr"}], "=", - "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"UtopiaVector", "::", "argerr"}], "=", @@ -3591,7 +3764,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"ZeroOneNormalization", "::", "argerr"}], "=", "\"\\""}], ";"}]}]}]], "Code",ExpressionUUID\ -->"b6e92997-b6a1-443d-8628-43e3ea8af988"], +->"7f2a3d3a-c1f3-47ed-adf0-13ae17aaf84a"], Cell[BoxData[ RowBox[{ @@ -3823,7 +3996,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"UtopiaSum", "::", "argerr"}], "=", "\"\\""}], ";"}]}]}]], "Code",ExpressionUU\ -ID->"9a0acafa-cea2-4ecd-9e3c-5403af85442e"], +ID->"df1c807d-7253-4888-afe8-3e64e84995be"], Cell[BoxData[ RowBox[{ @@ -3951,8 +4124,8 @@ Cell[BoxData[ RowBox[{"LinkCreate", "[", "]"}], ",", RowBox[{"{", RowBox[{"kc", "+", "6"}], "}"}]}], "]"}]}]}], "\n", " ", "]"}], - ";"}]}]}]], "Code",ExpressionUUID->"0e717ca7-cebd-4a5e-a44b-\ -0f6b63b051a3"], + ";"}]}]}]], "Code",ExpressionUUID->"2cba6317-c707-4694-9f14-\ +f7726956089a"], Cell[BoxData[ RowBox[{ @@ -4074,7 +4247,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DirectoryName", "[", "$InputFileName", "]"}], ",", " ", "\"\\""}], "}"}], "]"}]}]}]}]}], "\n", "]"}], - ";"}]}]}]], "Code",ExpressionUUID->"aa612b9a-6329-403d-aef2-2841365d5d8e"], + ";"}]}]}]], "Code",ExpressionUUID->"ebcc046c-7def-496c-be8d-162a779f2ba7"], Cell[BoxData[{ RowBox[{ @@ -4083,7 +4256,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Off", "[", RowBox[{"ConstrainedMax", "::", "deprec"}], "]"}], ";"}]}], "Code",Expressi\ -onUUID->"ba68b814-6e38-4272-94fd-73a2ee116e9f"], +onUUID->"fb4b8dac-9fab-4dec-bb2f-1ac0c6187c97"], Cell[BoxData[ RowBox[{ @@ -4114,6 +4287,18 @@ Cell[BoxData[ RowBox[{"approxrat", " ", "=", " ", RowBox[{"OptionValue", "[", "RationalApproximate", "]"}]}], ";", "\n", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"2", "^", + RowBox[{"Length", "[", "T", "]"}]}], ",", + RowBox[{"Length", "[", "values", "]"}]}], "]"}], ",", "True", ",", + + RowBox[{ + RowBox[{ + "Print", "[", "\"\\"", "]"}], ";", + RowBox[{"Return", "[", "]"}]}]}], "]"}], ";", "\n", " ", RowBox[{"If", "[", RowBox[{ RowBox[{ @@ -4148,7 +4333,7 @@ Cell[BoxData[ RowBox[{"{", RowBox[{"Coalitions", ",", " ", "values"}], "}"}]}], "]"}], ";"}]}], "]"}]}], ")"}]}], ";"}]}]}]], "Code",ExpressionUUID->\ -"e664ca7a-46fe-492f-8a1a-1e23fcf717f6"], +"ef917c83-6883-4676-b5d8-a4269646b8eb"], Cell[BoxData[{ RowBox[{ @@ -4163,7 +4348,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"CostSaving", "[", RowBox[{"costvec_List", ",", "T_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "cs", "}"}], ",", "\n", " ", RowBox[{ @@ -4183,13 +4368,12 @@ Cell[BoxData[{ RowBox[{ RowBox[{"(", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"c", "[", - RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], " ", "/@", " ", - "#"}]}], "]"}], " ", "-", " ", + RowBox[{"c", "[", + RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], " ", "/@", " ", + "#"}], "]"}], " ", "-", " ", RowBox[{"c", "[", "#", "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", RowBox[{"Subsets", "[", "T", "]"}]}]}], ";", "\n", " ", @@ -4198,8 +4382,8 @@ Cell[BoxData[{ RowBox[{"0", ",", RowBox[{"Drop", "[", RowBox[{"cs", ",", "1"}], "]"}]}], "}"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"26cf8fe4-ac7e-4dda-af92-\ -15942b336617"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"6a3a65d3-f4e5-469f-9fee-\ +5befa6c032ba"], Cell[BoxData[{ RowBox[{ @@ -4219,9 +4403,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "T", "]"}], "-", - RowBox[{"v", "[", - RowBox[{"Complement", "[", "#", "]"}], "]"}]}], "&"}], " ", "/@", - " ", + RowBox[{"v", "[", "#", "]"}]}], " ", "&"}], " ", "/@", " ", RowBox[{"Reverse", "[", "Coalitions", "]"}]}], ")"}]}], ";"}], "\n", "\n", RowBox[{"(*", "\n", @@ -4265,7 +4447,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"WeaklySuperAdditiveQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "truelist", "}"}], ",", "\n", " ", RowBox[{ @@ -4339,7 +4521,7 @@ Cell[BoxData[{ " ", ",", " ", "True"}], "]"}], ";", "\n", " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "clsup"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"785125cf-7683-43df-adbd-953936d8b555"], + ";"}]}], "Code",ExpressionUUID->"dd302531-6560-462b-83fe-f135a9eb7e79"], Cell[BoxData[ RowBox[{ @@ -4419,11 +4601,116 @@ Cell[BoxData[ RowBox[{"v", "[", "#", "]"}], "&"}], " ", "/@", " ", "Coalitions"}], ")"}], ",", "values"}], "]"}], "]"}]}], ";"}], "\n", "\n", + RowBox[{ + RowBox[{ + RowBox[{"WeightedMajority", "[", + RowBox[{"T_", ",", "weight_List"}], "]"}], ":=", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", "wgs", "}"}], ",", "\n", " ", + RowBox[{"Which", "[", + RowBox[{ + RowBox[{ + RowBox[{"Depth", "[", "weight", "]"}], "===", "3"}], ",", "\n", + " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"Length", "[", + RowBox[{"Last", "[", "weight", "]"}], "]"}], ",", + RowBox[{"Length", "[", "T", "]"}]}], "]"}], ",", "\n", + " ", + RowBox[{ + RowBox[{"wgs", "=", + RowBox[{"Flatten", "[", "weight", "]"}]}], ";", "\n", + " ", + RowBox[{"Which", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"Length", "[", "wgs", "]"}], ",", + RowBox[{ + RowBox[{"Length", "[", "T", "]"}], "+", "1"}]}], "]"}], ",", + + RowBox[{"WeightedMajMain", "[", + RowBox[{"T", ",", "wgs"}], "]"}], ",", "\n", + " ", "True", ",", + RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}]}], + ",", "\n", " ", + RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}], ",", + "\n", " ", + RowBox[{ + RowBox[{"Depth", "[", "weight", "]"}], "===", "2"}], ",", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"Length", "[", "weight", "]"}], ",", + RowBox[{ + RowBox[{"Length", "[", "T", "]"}], "+", "1"}]}], "]"}], ",", + "\n", " ", + RowBox[{"WeightedMajMain", "[", + RowBox[{"T", ",", "weight"}], "]"}], ",", "\n", + " ", + RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}], ",", + "\n", " ", "True", ",", + RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}]}], " ", + "\n", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"723d9fdf-9e76-48fd-\ +a7d8-fcdeba73c5fd"], + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"WeightedMajMain", "[", + RowBox[{"T_", ",", "weight_List"}], "]"}], " ", ":=", " ", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + "outersets", ",", "coalweights", ",", "sumweights", ",", "threshold"}], + "}"}], ",", "\n", " ", + RowBox[{ + RowBox[{"outersets", " ", "=", " ", + RowBox[{"Outer", "[", + RowBox[{"List", ",", " ", + RowBox[{"Subsets", "[", "T", "]"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"coalweights", " ", "=", " ", + RowBox[{ + RowBox[{ + RowBox[{"Extract", "[", + RowBox[{ + RowBox[{"Drop", "[", + RowBox[{"weight", ",", "1"}], "]"}], ",", " ", "#"}], "]"}], " ", + "&"}], " ", "/@", " ", "outersets"}]}], ";", "\n", " ", + RowBox[{"sumweights", " ", "=", " ", + RowBox[{ + RowBox[{ + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "coalweights"}]}], ";", "\n", " ", + RowBox[{"threshold", " ", "=", " ", + RowBox[{"First", "[", "weight", "]"}]}], ";", " ", "\n", " ", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GreaterEqual", "[", + RowBox[{"#", ",", " ", "threshold"}], "]"}], " ", "&"}], " ", "/@", + " ", "sumweights"}], " ", "/.", " ", + RowBox[{"True", " ", "->", " ", "1"}]}], " ", "/.", " ", + RowBox[{"False", " ", "->", " ", "0"}]}]}]}], " ", "\n", "]"}]}], + ";"}], "\n"}]], "Code",ExpressionUUID->"0852eca1-7005-42cf-9e98-\ +e52db7d08a63"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"(*", "\n", RowBox[{ RowBox[{ RowBox[{"WeightedMajority", "[", RowBox[{"T_", ",", "weight_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -4434,12 +4721,10 @@ Cell[BoxData[ RowBox[{"Off", "[", RowBox[{"Part", "::", "partd"}], "]"}], ";", "\n", " ", RowBox[{"outersets", " ", "=", " ", - RowBox[{ - RowBox[{ - RowBox[{"Outer", "[", - RowBox[{"List", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", - RowBox[{"Subsets", "[", "T", "]"}]}]}], ";", "\n", " ", + RowBox[{"Outer", "[", + RowBox[{"List", ",", " ", + RowBox[{"Subsets", "[", "T", "]"}]}], "]"}]}], ";", "\n", + " ", RowBox[{"coalweights", " ", "=", " ", RowBox[{"Which", "[", RowBox[{ @@ -4469,9 +4754,8 @@ Cell[BoxData[ RowBox[{"sumweights", " ", "=", " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", "coalweights"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "coalweights"}]}], ";", "\n", " ", RowBox[{"threshold", " ", "=", " ", RowBox[{"Which", "[", RowBox[{ @@ -4525,18 +4809,58 @@ Cell[BoxData[ RowBox[{"#", ",", " ", "threshold"}], "]"}], " ", "&"}], " ", "/@", " ", "sumweights"}]}], ";", "\n", " ", RowBox[{ - RowBox[{ - RowBox[{"Which", "[", + RowBox[{"boolval", " ", "/.", " ", + RowBox[{"True", " ", "->", " ", "1"}]}], " ", "/.", " ", + RowBox[{"False", " ", "->", " ", "0"}]}]}]}], "\n", "]"}]}], ";"}], + "\n", "*)"}], "\n", "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"StandardSolution", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"StandardSolution", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"StandardSolution", "[", "game_", "]"}], ":=", + RowBox[{"Module", "[", + RowBox[{ + RowBox[{"{", "dmQ", "}"}], ",", "\n", " ", + RowBox[{ + RowBox[{"dmQ", "=", + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"2", "^", + RowBox[{"Length", "[", "T", "]"}]}], ",", + RowBox[{"2", "^", "2"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"If", "[", + RowBox[{"dmQ", ",", + RowBox[{ RowBox[{ - RowBox[{"#", " ", "===", " ", "True"}], ",", " ", "1", ",", " ", - "True", ",", " ", "0"}], "]"}], " ", "&"}], " ", "/@", " ", - "boolval"}]}]}], "\n", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->\ -"de163382-7634-4640-a2bd-126f226edd23"], - -Cell[BoxData[ - RowBox[{"(*", " ", - RowBox[{"Section", " ", "general", " ", "functions", " ", "ends"}], " ", - "*)"}]], "Code",ExpressionUUID->"1bd3af4a-f881-489f-a81f-79f5bf555958"], + RowBox[{ + RowBox[{"v", "[", + RowBox[{"{", "#", "}"}], "]"}], " ", "+", " ", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], "-", + RowBox[{"v", "[", + RowBox[{"{", "1", "}"}], "]"}], "-", + RowBox[{"v", "[", + RowBox[{"{", "2", "}"}], "]"}]}], ")"}], "/", "2"}]}], " ", + "&"}], "/@", " ", "T"}], ",", "\n", " ", + RowBox[{ + RowBox[{ + "Print", "[", "\"\\"", "]"}], ";", + + RowBox[{"Return", "[", "]"}]}]}], "]"}]}]}], "\n", " ", "]"}]}], + ";"}], "\n", "\n", + RowBox[{"(*", " ", + RowBox[{"Section", " ", "general", " ", "functions", " ", "ends"}], " ", + "*)"}]}]}]], "Code",ExpressionUUID->"12ab05d3-2554-4963-9d12-\ +337cb69d96fd"], Cell[BoxData[ RowBox[{ @@ -4669,7 +4993,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ConvexQ", "[", "game_", "]"}], ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "liste", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -4765,7 +5089,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ConvexStrQ", "[", "game_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "liste", "}"}], ",", "\n", "\t\t", RowBox[{ @@ -4797,7 +5121,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AverageConvexQ", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -4854,7 +5178,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AverageConvexQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"supset", ",", " ", "smarg", ",", " ", "dispres"}], "}"}], @@ -4890,124 +5214,123 @@ Cell[BoxData[ RowBox[{ RowBox[{"Last", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "smarg"}]}], "}"}]}], "\n", " ", "]"}]}]}], "\n", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"3ec4b9ce-679d-4ad8-a69b-\ -e6b18fb654da"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"2b1dde06-8a18-487f-87aa-\ +605b262c1642"], -Cell[BoxData[{ - RowBox[{ - RowBox[{ - RowBox[{ - RowBox[{"OberMenge", "[", - RowBox[{"teilmg_List", ",", " ", "T_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", - RowBox[{ - RowBox[{"{", - RowBox[{"compl", ",", "subc", ",", "prop"}], "}"}], ",", "\n", " ", - - RowBox[{ - RowBox[{"compl", " ", "=", " ", - RowBox[{"Complement", "[", - RowBox[{"T", ",", " ", "teilmg"}], "]"}]}], ";", "\n", " ", - RowBox[{"subc", "=", - RowBox[{"Subsets", "[", "compl", "]"}]}], ";", "\n", " ", - RowBox[{"prop", "=", - RowBox[{ - RowBox[{ - RowBox[{"Join", "[", - RowBox[{"teilmg", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", "subc"}]}], ";", "\n", " ", - RowBox[{ - RowBox[{ - RowBox[{"Sort", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "prop"}]}]}], "\n", "\n", "]"}]}], ";"}], "\n"}], "\n", +Cell[BoxData[ RowBox[{ RowBox[{ - RowBox[{"SumMargContribution", "[", - RowBox[{"superset_List", ",", " ", "teilmg_List", ",", " ", - RowBox[{"opts", ":", - RowBox[{"OptionsPattern", "[", "AverageConvexQ", "]"}]}]}], "]"}], " ", - ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"OberMenge", "[", + RowBox[{"teilmg_List", ",", " ", "T_List"}], "]"}], " ", ":=", " ", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", - RowBox[{ - "dispres", ",", " ", "delisp", ",", " ", "delitlm", ",", " ", "sumtmg", - ",", " ", "add", ",", " ", "nnegQ"}], "}"}], ",", "\n", " ", + RowBox[{"compl", ",", "subc", ",", "prop"}], "}"}], ",", "\n", " ", RowBox[{ - RowBox[{"dispres", " ", "=", " ", - RowBox[{"OptionValue", "[", "DisplayAllResults", "]"}]}], ";", "\n", - " ", - RowBox[{"delisp", " ", "=", " ", - RowBox[{ - RowBox[{ - RowBox[{"DeleteCases", "[", - RowBox[{"superset", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", "teilmg"}]}], ";", "\n", " ", - RowBox[{"delitlm", " ", "=", " ", + RowBox[{"compl", " ", "=", " ", + RowBox[{"Complement", "[", + RowBox[{"T", ",", " ", "teilmg"}], "]"}]}], ";", "\n", " ", + RowBox[{"subc", "=", + RowBox[{"Subsets", "[", "compl", "]"}]}], ";", "\n", " ", + RowBox[{"prop", "=", RowBox[{ RowBox[{ - RowBox[{"DeleteCases", "[", + RowBox[{"Join", "[", RowBox[{"teilmg", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", "teilmg"}]}], ";", "\n", " ", - RowBox[{"sumtmg", " ", "=", " ", - RowBox[{"MapThread", "[", - RowBox[{ - RowBox[{ - RowBox[{"(", - RowBox[{ - RowBox[{"v", "[", "superset", "]"}], " ", "-", " ", - RowBox[{"v", "[", "#1", "]"}], " ", "-", " ", - RowBox[{"v", "[", "teilmg", "]"}], " ", "+", " ", - RowBox[{"v", "[", "#2", "]"}]}], ")"}], " ", "&"}], ",", " ", - RowBox[{"{", - RowBox[{"delisp", ",", " ", "delitlm"}], "}"}]}], "]"}]}], ";", - "\n", " ", - RowBox[{"add", " ", "=", " ", - RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "sumtmg"}], "]"}], " ", "//", " ", - "Simplify"}]}], ";", "\n", " ", - RowBox[{"nnegQ", " ", "=", " ", - RowBox[{"NonNegative", "[", "add", "]"}]}], ";", "\n", " ", - RowBox[{"Which", "[", + " ", "subc"}]}], ";", "\n", " ", + RowBox[{ RowBox[{ - RowBox[{"SameQ", "[", - RowBox[{"dispres", ",", "False"}], "]"}], ",", " ", "nnegQ", ",", - "\n", " ", "True", ",", " ", - RowBox[{"{", - RowBox[{"nnegQ", ",", " ", "add"}], "}"}]}], "]"}]}]}], "\n", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"f3129a3f-0b6f-491c-a6a0-\ -cbf6f5bdf1d1"], + RowBox[{"Sort", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "prop"}]}]}], "\n", "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->\ +"668c0860-e5d8-4d4f-a46b-4a39838be0f4"], -Cell[BoxData[ +Cell[BoxData[{ RowBox[{ - RowBox[{"(*", " ", - RowBox[{ - RowBox[{"AvConvexQ", "[", "]"}], " ", "is", " ", "same", " ", "as", " ", - RowBox[{"AverageConvexQ", "[", "]"}]}], " ", "*)"}], "\n", "\n", RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"AvConvexQ", "[", "args___", "]"}], ":=", - RowBox[{"(", + RowBox[{"SumMargContribution", "[", + RowBox[{"superset_List", ",", " ", "teilmg_List", ",", " ", + RowBox[{"opts", ":", + RowBox[{"OptionsPattern", "[", "AverageConvexQ", "]"}]}]}], "]"}], " ", + ":=", " ", "\n", " ", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + "dispres", ",", " ", "delisp", ",", " ", "delitlm", ",", " ", "sumtmg", + ",", " ", "add", ",", " ", "nnegQ"}], "}"}], ",", "\n", " ", RowBox[{ - RowBox[{"Message", "[", - RowBox[{"AvConvexQ", "::", "argerr"}], "]"}], ";", "$Failed"}], - ")"}]}], ";"}], "\n", "\n", + RowBox[{"dispres", " ", "=", " ", + RowBox[{"OptionValue", "[", "DisplayAllResults", "]"}]}], ";", "\n", + " ", + RowBox[{"delisp", " ", "=", " ", + RowBox[{ + RowBox[{ + RowBox[{"DeleteCases", "[", + RowBox[{"superset", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", + " ", "teilmg"}]}], ";", "\n", " ", + RowBox[{"delitlm", " ", "=", " ", + RowBox[{ + RowBox[{ + RowBox[{"DeleteCases", "[", + RowBox[{"teilmg", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", + " ", "teilmg"}]}], ";", "\n", " ", + RowBox[{"sumtmg", " ", "=", " ", + RowBox[{"MapThread", "[", + RowBox[{ + RowBox[{ + RowBox[{"N", "[", + RowBox[{ + RowBox[{"v", "[", "superset", "]"}], " ", "-", " ", + RowBox[{"v", "[", "#1", "]"}], " ", "-", " ", + RowBox[{"v", "[", "teilmg", "]"}], " ", "+", " ", + RowBox[{"v", "[", "#2", "]"}]}], "]"}], " ", "&"}], ",", " ", + RowBox[{"{", + RowBox[{"delisp", ",", " ", "delitlm"}], "}"}]}], "]"}]}], ";", + "\n", " ", + RowBox[{"add", " ", "=", " ", + RowBox[{ + RowBox[{"Total", "[", "sumtmg", "]"}], " ", "//", " ", + "Simplify"}]}], ";", "\n", " ", + RowBox[{"nnegQ", " ", "=", " ", + RowBox[{"NonNegative", "[", "add", "]"}]}], ";", "\n", " ", + RowBox[{"Which", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"dispres", ",", "False"}], "]"}], ",", " ", "nnegQ", ",", + "\n", " ", "True", ",", " ", + RowBox[{"{", + RowBox[{"nnegQ", ",", " ", "add"}], "}"}]}], "]"}]}]}], "\n", + "]"}]}], ";"}], "\n", "\n", + RowBox[{"(*", " ", RowBox[{ - RowBox[{ - RowBox[{"AvConvexQ", "[", - RowBox[{"game_", ",", " ", - RowBox[{"opts", ":", - RowBox[{"OptionsPattern", "[", "AverageConvexQ", "]"}]}]}], "]"}], - " ", ":=", " ", - RowBox[{"AverageConvexQ", "[", - RowBox[{"game", ",", " ", "opts"}], "]"}]}], ";"}], "\n", "\n", - RowBox[{"(*", " ", - RowBox[{ - "Old", " ", "Average", " ", "Convex", " ", "Function", " ", "is", " ", - "deprecated"}], " ", "*)"}]}]}]], "Code",ExpressionUUID->"a811af8e-1baa-\ -4450-bad5-90509a81725b"], + RowBox[{"AvConvexQ", "[", "]"}], " ", "is", " ", "same", " ", "as", " ", + RowBox[{"AverageConvexQ", "[", "]"}]}], " ", "*)"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"AvConvexQ", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"AvConvexQ", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"AvConvexQ", "[", + RowBox[{"game_", ",", " ", + RowBox[{"opts", ":", + RowBox[{"OptionsPattern", "[", "AverageConvexQ", "]"}]}]}], "]"}], + " ", ":=", " ", + RowBox[{"AverageConvexQ", "[", + RowBox[{"game", ",", " ", "opts"}], "]"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{"(*", " ", + RowBox[{ + "Old", " ", "Average", " ", "Convex", " ", "Function", " ", "is", " ", + "deprecated"}], " ", "*)"}]}]}], "Code",ExpressionUUID->"b15f6c52-f013-\ +4057-8aa8-2144008642c1"], Cell[BoxData[ RowBox[{ @@ -5033,7 +5356,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ZeroMonotoneQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -5073,7 +5396,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ZeroNormalization", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"genIndVal", ",", " ", "addIndVal", ",", " ", "coalval"}], @@ -5095,9 +5418,8 @@ Cell[BoxData[ RowBox[{"addIndVal", " ", "=", " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", "genIndVal"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "genIndVal"}]}], ";", "\n", " ", RowBox[{"Subtract", "[", RowBox[{"coalval", ",", " ", "addIndVal"}], "]"}]}]}], "\n", " ", "]"}]}], ";"}], "\n", "\n", @@ -5112,7 +5434,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ZeroOneNormalization", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"zeroli", ",", " ", "div"}], "}"}], ",", "\n", " ", @@ -5141,7 +5463,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"OneNormalization", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "newgame", "}"}], ",", "\n", " ", RowBox[{ @@ -5179,7 +5501,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"GameMonotoneQ", "[", "game_", "]"}], ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "liste", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -5195,8 +5517,8 @@ Cell[BoxData[ RowBox[{"And", ",", RowBox[{"Apply", "[", RowBox[{"And", ",", "liste", ",", "1"}], "]"}]}], "]"}]}]}], "\n", - "\t", "]"}]}], ";"}], "\n"}]}]], "Code",ExpressionUUID->"f741fa4b-f9d6-\ -4f06-87c9-12cb225cc20a"], + "\t", "]"}]}], ";"}], "\n"}]}]], "Code",ExpressionUUID->"07145e91-bfa2-\ +4949-a7f6-141fd3c66c37"], Cell[BoxData[ RowBox[{ @@ -5204,7 +5526,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"MargContribPositive", "[", RowBox[{"game_", ",", "i_Integer"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "margli", "}"}], ",", "\n", " ", RowBox[{ @@ -5229,7 +5551,7 @@ Cell[BoxData[ RowBox[{"j", ",", RowBox[{"Length", "[", "margli", "]"}]}], "}"}]}], "]"}]}], "}"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}], "\n"}]], "Code",Expre\ -ssionUUID->"77745ff7-1220-44f8-9d6e-f81e11dd0f6b"], +ssionUUID->"a2a7b36c-09b0-4547-83db-178591a5e58d"], Cell[BoxData[{ RowBox[{ @@ -5243,14 +5565,14 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"MonotoneQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "coal", "}"}], ",", "\n", " ", RowBox[{ RowBox[{"coal", " ", "=", " ", "Coalitions"}], ";", "\n", " ", RowBox[{"MonoCheck", "[", RowBox[{"game", ",", " ", "coal"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"030a0fa4-817e-48ca-b4e0-4cd13eff7745"], + ";"}]}], "Code",ExpressionUUID->"a11e0676-b612-411c-90f4-93fa83b5592a"], Cell[BoxData[ RowBox[{ @@ -5264,7 +5586,7 @@ Cell[BoxData[ RowBox[{"MonoCheck", "[", RowBox[{"game_", ",", " ", "liste_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -5323,8 +5645,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"(", "zero", ")"}], "-", RowBox[{"monotonicity", " ", "section", " ", "ends"}]}], " ", "*)"}], - "\n", "\n"}]}]], "Code",ExpressionUUID->"88ce42e2-2e75-4a47-8e9f-\ -a2f4677e3f1a"], + "\n", "\n"}]}]], "Code",ExpressionUUID->"b43f9828-948d-4f34-a690-\ +c9f3a76ee4c3"], Cell[BoxData[ RowBox[{ @@ -5411,7 +5733,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"FirstCriticalVal", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "con", "}"}], ",", "\n", " ", RowBox[{ @@ -5450,7 +5772,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"SecondCriticalVal", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "cval2", "}"}], ",", "\n", " ", RowBox[{ @@ -5461,14 +5783,13 @@ Cell[BoxData[ RowBox[{"(", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"Map", "[", + RowBox[{"Total", "[", + RowBox[{"Map", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"v", "[", - RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], ",", " ", - "#"}], "]"}]}], "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", + RowBox[{"v", "[", + RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], ",", " ", + "#"}], "]"}], "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", "ProperCoalitions"}], "]"}]}], ";", "\n", " ", RowBox[{"MapThread", "[", RowBox[{"Rule", ",", " ", @@ -5488,7 +5809,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ThirdCriticalVal", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "cval3", "}"}], ",", "\n", " ", RowBox[{ @@ -5501,14 +5822,14 @@ Cell[BoxData[ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", RowBox[{"v", "[", "T", "]"}], " ", "+", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"Map", "[", + RowBox[{"Total", "[", + RowBox[{"Map", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"Global`r", "[", "#1", "]"}], " ", "&"}], ",", " ", - RowBox[{"Complement", "[", - RowBox[{"T", ",", "#"}], "]"}]}], "]"}]}], "]"}]}], ")"}], + RowBox[{"Global`r", "[", "#1", "]"}], " ", "&"}], ",", " ", + + RowBox[{"Complement", "[", + RowBox[{"T", ",", "#"}], "]"}]}], "]"}], "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", "ProperCoalitions"}], "]"}]}], ";", "\n", " ", RowBox[{"MapThread", "[", @@ -5529,7 +5850,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"FourthCriticalVal", "[", "game_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "cval4", "}"}], ",", "\n", " ", RowBox[{ @@ -5564,7 +5885,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"StarCriticalVal", "[", "game_", "]"}], " ", ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"cval", ",", " ", "upbd"}], "}"}], ",", "\n", " ", @@ -5589,13 +5910,12 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"v", "[", + RowBox[{"v", "[", RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], " ", "/@", - " ", "#"}]}], "]"}]}], ",", " ", "\n", " ", + " ", "#"}], "]"}]}], ",", " ", "\n", " ", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "+", " ", RowBox[{"(", @@ -5643,7 +5963,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"SecondStarCriticalVal", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -5734,7 +6054,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ThirdStarCriticalVal", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -5823,7 +6143,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"CaseOne", "[", RowBox[{"game_", ",", " ", "uppara_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"Max", "[", @@ -5842,13 +6162,12 @@ Cell[BoxData[ RowBox[{"v", "[", "T", "]"}]}], ")"}], ",", " ", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"v", "[", - RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], " ", "/@", - " ", "#"}]}], "]"}]}], ",", " ", "0"}], "}"}], "]"}], " ", + RowBox[{"v", "[", + RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], " ", "/@", + " ", "#"}], "]"}]}], ",", " ", "0"}], "}"}], "]"}], " ", "&"}], " ", "/@", " ", "ProperCoalitions"}], " ", "/.", " ", "uppara"}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{ @@ -5856,7 +6175,7 @@ Cell[BoxData[ RowBox[{"CaseTwo", "[", RowBox[{"game_", ",", " ", "lwpara_List", ",", " ", "uppara_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", " ", RowBox[{"Max", "[", @@ -5872,13 +6191,12 @@ Cell[BoxData[ RowBox[{"m", "[", "#", "]"}]}], ",", " ", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"v", "[", + RowBox[{"v", "[", RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], " ", "/@", - " ", "#"}]}], "]"}]}], ",", " ", + " ", "#"}], "]"}]}], ",", " ", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "+", " ", RowBox[{"up", "[", @@ -5892,7 +6210,7 @@ Cell[BoxData[ RowBox[{"CaseThree", "[", RowBox[{"game_", ",", " ", "lwpara_List", ",", " ", "uppara_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"Max", "[", @@ -5912,13 +6230,12 @@ Cell[BoxData[ "]"}], ",", " ", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"v", "[", + RowBox[{"v", "[", RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], " ", "/@", - " ", "#"}]}], "]"}]}], ",", " ", + " ", "#"}], "]"}]}], ",", " ", RowBox[{"(", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "+", " ", @@ -5934,7 +6251,7 @@ Cell[BoxData[ RowBox[{"CaseThreeFor3", "[", RowBox[{"game_", ",", " ", "lwpara_List", ",", " ", "uppara_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"Max", "[", @@ -5953,13 +6270,12 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"{", "#1", "}"}], "]"}], " ", "&"}], " ", "/@", - " ", "#"}]}], "]"}]}], ",", + " ", "#"}], "]"}]}], ",", RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "-", " ", RowBox[{"m", "[", "#", "]"}]}]}], "}"}], "]"}], ",", @@ -5977,7 +6293,7 @@ Cell[BoxData[ "]"}]}], "}"}], "]"}], " ", "&"}], " ", "/@", " ", "ProperCoalitions"}], " ", "/.", " ", "lwpara"}], " ", "/.", " ", "uppara"}], "]"}]}], "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->\ -"311a2d97-7321-49cf-8bac-ebd887f7f824"], +"62663577-61d8-4aaf-aaac-72ed8f153e15"], Cell[BoxData[{ RowBox[{ @@ -5992,7 +6308,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"FifthCriticalVal", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"lwbd", ",", " ", "lwpara", ",", "cval5"}], "}"}], ",", "\n", @@ -6069,7 +6385,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"UpperSetQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"upbd", ",", "uppara"}], "}"}], ",", "\n", " ", @@ -6091,7 +6407,7 @@ Cell[BoxData[{ RowBox[{"up", "[", "T", "]"}], " ", "/.", " ", "uppara"}], ")"}], " ", ">=", " ", RowBox[{"v", "[", "T", "]"}]}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"ff5a90b6-3677-4ef9-823d-b20a53e3d05d"], + ";"}]}], "Code",ExpressionUUID->"0eb4bb59-5140-4af3-8a90-807347119ea7"], Cell[BoxData[{ RowBox[{ @@ -6106,7 +6422,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"LowerSetQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"lwbd", ",", " ", "lwpara"}], "}"}], ",", "\n", " ", @@ -6146,7 +6462,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "LowerSetIncImputationQ", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "sil", "}"}], ",", "\n", " ", RowBox[{ @@ -6189,7 +6505,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "UpperSetIncImputationQ", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sil", ",", "prub", ",", " ", "prpara", ",", " ", "setwoi"}], @@ -6239,7 +6555,7 @@ Cell[BoxData[{ RowBox[{ "Print", "[", "\"\\"", "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUI\ -D->"88e68efc-9d0a-49ba-9ff2-fa3c5c9a66a3"], +D->"2cd25c76-b2c5-4415-9b69-59eed8f878c7"], Cell[BoxData[{ RowBox[{ @@ -6268,7 +6584,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"IntersectionUpperLowerSetQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -6288,7 +6604,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"GrandCoalitionLargestValueQ", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -6315,7 +6631,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelEqualsKernelQ", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "sil", "}"}], ",", "\n", " ", RowBox[{ @@ -6544,7 +6860,7 @@ empty\>\"", "]"}], ";", "\n", " ", RowBox[{ RowBox[{ RowBox[{"ReasonableSet", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "assr", "}"}], ",", "\n", " ", RowBox[{ @@ -6566,8 +6882,8 @@ empty\>\"", "]"}], ";", "\n", " ", RowBox[{"(*", " ", RowBox[{ "strong", " ", "epsilon", " ", "core", " ", "section", " ", "ends"}], " ", - "*)"}], " "}], "\n"}], "Code",ExpressionUUID->"a9de2869-c735-413b-8ef3-\ -d841e7a26a5a"], + "*)"}], " "}], "\n"}], "Code",ExpressionUUID->"df3315ce-e262-4d0a-b102-\ +f282e4bffcaa"], Cell[BoxData[{ RowBox[{ @@ -6582,7 +6898,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"NewShapley", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pot", "}"}], ",", "\n", " ", RowBox[{ @@ -6640,16 +6956,15 @@ Cell[BoxData[{ RowBox[{"(", RowBox[{ RowBox[{"v", "[", "S", "]"}], "+", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"rho", "[", - RowBox[{"DeleteCases", "[", - RowBox[{"S", ",", "#"}], "]"}], "]"}], " ", "&"}], "/@", " ", - "S"}]}], "]"}]}], ")"}], "/", + RowBox[{"rho", "[", + RowBox[{"DeleteCases", "[", + RowBox[{"S", ",", "#"}], "]"}], "]"}], " ", "&"}], "/@", " ", + "S"}], "]"}]}], ")"}], "/", RowBox[{"Length", "[", "S", "]"}]}]}]}], ";"}]}], "Code",ExpressionUUID->\ -"78876d09-74e4-4a54-bc65-6b1b705fdcfb"], +"1b2fc825-7a40-4265-aaa2-cd5845cecd46"], Cell[BoxData[{ RowBox[{ @@ -6664,7 +6979,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"ShapleyValueML", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -6716,7 +7031,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"MLExtension", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"ss", ",", "cS", ",", "ms", ",", "ns", ",", "smd"}], "}"}], ",", @@ -6765,10 +7080,9 @@ Cell[BoxData[{ RowBox[{"i", ",", RowBox[{"Length", "[", "ms", "]"}]}], "}"}]}], "]"}]}], ";", "\n", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "smd"}], "]"}]}]}], "\t\t\t ", "\n", "\t\t ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"d1553023-3c4e-4501-b801-\ -f44fe6503aaf"], + RowBox[{"Total", "[", "smd", "]"}]}]}], "\t\t\t ", "\n", "\t\t ", + "]"}]}], ";"}]}], "Code",ExpressionUUID->"f78b3fb1-4585-4bd2-8c1e-\ +5b65a7957b97"], Cell[BoxData[{ RowBox[{ @@ -6812,7 +7126,7 @@ single payoff vector.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ExcessPayoff", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"dispmat", ",", "assg", ",", "li", ",", "res"}], "}"}], ",", @@ -6875,7 +7189,7 @@ single payoff vector.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{"DisplayErgb", "[", "payoff_List", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"exc", ",", "coal", ",", "mpc"}], "}"}], ",", "\n", " ", @@ -6903,7 +7217,7 @@ single payoff vector.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{"MaxExcessSets", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -6954,7 +7268,7 @@ single payoff vector.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{"IntersectionOfMaxExcessSets", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dsets", "}"}], ",", "\n", " ", RowBox[{ @@ -7008,7 +7322,7 @@ single payoff vector.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", "\"\\"", ",", " ", RowBox[{"KernelImputationListQ", "[", RowBox[{"game", ",", "payoff"}], "]"}]}], "]"}], ";"}], ")"}]}], - ";"}]}], "Code",ExpressionUUID->"d989a524-58f9-4b0c-a2db-0aed455c563d"], + ";"}]}], "Code",ExpressionUUID->"c7da071e-5179-4381-95d2-9a7b60a375d1"], Cell[BoxData[{ RowBox[{ @@ -7031,7 +7345,7 @@ Cell[BoxData[{ RowBox[{"___", ",", "i", ",", "___"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"___", ",", "j", ",", "___"}], "}"}]}], "]"}]}], ";"}]}], "Code",\ -ExpressionUUID->"509d813d-4240-4a53-a076-9ad2aabd3e3b"], +ExpressionUUID->"ab173fcb-7d5c-404d-8dbc-bf4f92563803"], Cell[BoxData[{ RowBox[{ @@ -7047,7 +7361,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"MaxExcessBalanced", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", "\n", " ", RowBox[{ @@ -7101,7 +7415,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"MaxExcessBalCheck", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -7210,7 +7524,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"MinExcessBalanced", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", "\n", " ", RowBox[{ @@ -7264,7 +7578,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"MinExcessBalCheck", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -7372,7 +7686,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"Quota", "[", "game_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"secsize", ",", "matrix"}], "}"}], ",", "\n", "\t\t ", @@ -7413,7 +7727,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"VerticesCore", "[", "game_", "]"}], ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"liste", ",", "mat", ",", "values"}], "}"}], ",", "\n", " ", @@ -7455,7 +7769,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"-", "mat"}], ",", RowBox[{"-", "values"}]}], "]"}]}]}], "\n", "\t ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"1a087288-9585-4dbf-9a2e-85c3c878e040"], + ";"}]}], "Code",ExpressionUUID->"b62219f2-8cdd-45c8-9baa-4eb1ddcaa6a6"], Cell[BoxData[ RowBox[{ @@ -7529,12 +7843,11 @@ Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "T"}]}], "]"}], "}"}], ",", " ", + RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "T"}], "]"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"v", "[", "T", "]"}], "}"}]}], "}"}]}], "]"}]}], ";", "\n", " ", @@ -7644,7 +7957,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ModifiedKernel", "]"}]}]}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -7685,12 +7998,11 @@ Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "T"}]}], "]"}], "}"}], ",", " ", + RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "T"}], "]"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"v", "[", "T", "]"}], "}"}]}], "}"}]}], "]"}]}], ";", "\n", " ", @@ -7786,7 +8098,7 @@ Cell[BoxData[ RowBox[{ "game", ",", "obf", ",", " ", "cmat", ",", " ", "bvect", ",", "bds"}], "]"}]}]}], "\n", " ", "]"}]}], ";"}]}]}]], "Code",Expres\ -sionUUID->"4c414217-5e21-473e-b27d-d5d26897680e"], +sionUUID->"4d9fa1d3-41d5-42b6-9459-e1bd867bc816"], Cell[BoxData[{ RowBox[{ @@ -7805,7 +8117,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreNucleolus", "]"}]}]}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -7832,12 +8144,11 @@ Cell[BoxData[{ RowBox[{"{", RowBox[{ RowBox[{"{", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "T"}]}], "]"}], "}"}], ",", " ", + RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "T"}], "]"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"v", "[", "T", "]"}], "}"}]}], "}"}]}], "]"}]}], ";", "\n", " ", @@ -7906,126 +8217,679 @@ Cell[BoxData[{ " ", RowBox[{"ModifiedNucleolus", "[", RowBox[{"game", ",", "opts"}], "]"}]}], ";"}], "\n"}], "Code",ExpressionUU\ -ID->"4c49bb6b-54f6-4707-b7f5-61da3dc9d88a"], +ID->"10e2a838-3622-4c38-9c2d-279bd708c223"], -Cell[BoxData[ +Cell[BoxData[{ RowBox[{ RowBox[{ - RowBox[{"EssentialQ", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", - RowBox[{ - RowBox[{"{", - RowBox[{"indrat", ",", "sumirat", ",", "zeroess"}], "}"}], ",", " ", - "\n", " ", + RowBox[{ + RowBox[{"EssentialQ", "[", "game_", "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ - RowBox[{"indrat", "=", " ", - RowBox[{ + RowBox[{"{", + RowBox[{"indrat", ",", "sumirat", ",", "zeroess"}], "}"}], ",", " ", + "\n", " ", + RowBox[{ + RowBox[{"indrat", "=", " ", RowBox[{ - RowBox[{"v", "[", - RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], "/@", "T"}]}], ";", - " ", "\n", " ", - RowBox[{"sumirat", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "indrat"}], "]"}]}], ";", "\n", " ", - RowBox[{"zeroess", " ", "=", " ", - RowBox[{"sumirat", "<=", - RowBox[{"v", "[", "T", "]"}]}]}]}]}], " ", "\n", " ", "]"}]}], - ";"}]], "Code",ExpressionUUID->"fa1bfb32-e047-400f-8344-a6bdbe05e95a"], - -Cell[BoxData[ - RowBox[{"(*", " ", "\n", " ", - RowBox[{ - RowBox[{ - RowBox[{ - "The", " ", "next", " ", "function", " ", "translates", " ", "the", " ", - "definition", " ", "of", " ", "the", " ", "Nucleolus", " ", "into", "\n", - " ", "a", " ", "sequence", " ", "of", " ", "linear", " ", "programs", - " ", "on", " ", "the", " ", "pre"}], "-", - RowBox[{"imputation", " ", - RowBox[{"set", ".", " ", "\n", " ", "To"}], " ", "obtain", " ", "a", " ", - "pre"}], "-", - RowBox[{ - "kernel", " ", "solution", " ", "the", " ", "recursion", " ", "stops"}]}], - ",", " ", - RowBox[{"in", " ", "general"}], ",", " ", - RowBox[{ - "before", "\n", " ", "the", " ", "nucleolus", " ", "of", " ", "the", " ", - "game", " ", "has", " ", "been", " ", - RowBox[{"computed", ".", " ", "One"}], " ", "stopping", " ", "criterion", - " ", "of", " ", "\n", " ", "the", " ", "recursion", " ", "procedure", " ", - "is", " ", "if", " ", "the", " ", "set", " ", "of", " ", "new", " ", - "equal", " ", "constraints", " ", "is", " ", - RowBox[{"empty", ".", " ", "\n", " ", "C", ".", "f", ".", " ", "Owen"}], - " ", "1974", " ", "and", " ", "Owen", " ", + RowBox[{ + RowBox[{"v", "[", + RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], "/@", "T"}]}], ";", + " ", "\n", " ", + RowBox[{"sumirat", " ", "=", " ", + RowBox[{"Total", "[", "indrat", "]"}]}], ";", "\n", " ", + RowBox[{"zeroess", " ", "=", " ", + RowBox[{"sumirat", "<=", + RowBox[{"v", "[", "T", "]"}]}]}]}]}], " ", "\n", " ", "]"}]}], + ";"}], "\n", "\n", + RowBox[{"(*", " ", + RowBox[{ + "Formula", " ", "of", " ", "the", " ", "Nucleolus", " ", "for", " ", + "Three", " ", "Person", " ", "Games", " ", RowBox[{"(", - RowBox[{"1995", ",", " ", + RowBox[{ RowBox[{ - RowBox[{"pp", ".322"}], "-", "334."}]}], ")"}]}]}], "\n", - "*)"}]], "Code",ExpressionUUID->"7ae1a06b-b039-4b6a-b32c-51da4a1c1b7a"], - -Cell[BoxData[ + RowBox[{"cf", ".", " ", "Leng"}], " ", "and", " ", "Parlar"}], ",", + " ", "2010"}], ")"}]}], "*)"}], "\n"}], "\n", RowBox[{ RowBox[{ - RowBox[{"SeqLP", "[", - RowBox[{ - "obf_", ",", " ", "cmat_List", ",", " ", "bvect_List", ",", "bds_List", - ",", - RowBox[{"bA_:", - RowBox[{"{", "}"}]}]}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Block", "[", + RowBox[{"NucleolusThreePerson", "[", "args___", "]"}], ":=", + RowBox[{"(", RowBox[{ - RowBox[{"{", - RowBox[{ - "cmat1", ",", "dl1", ",", "dl2", ",", "dl3", ",", "dl4", ",", "res", - ",", "rl2", ",", "const01", ",", "const02", ",", "const", ",", "gr", - ",", "ps", ",", "al1", ",", "psal1", ",", "ov", ",", "ps1", ",", "zv", - ",", "rl", ",", "bA1", ",", "lb", ",", "bA2", ",", "ons", ",", "wghs", - ",", "mr", ",", "pw", ",", "pwQ", ",", "extb", ",", "bvect1", ",", - "twv", ",", "ps2", ",", "rl3", ",", "zQ"}], "}"}], ",", "\n", " ", + RowBox[{"Message", "[", + RowBox[{"NucleolusThreePerson", "::", "argerr"}], "]"}], ";", + "$Failed"}], ")"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"NucleolusThreePerson", "[", "game_", "]"}], " ", ":=", " ", "\n", + " ", + RowBox[{"Block", "[", RowBox[{ - RowBox[{"cmat1", "=", - RowBox[{"SparseArray", "[", "cmat", "]"}]}], ";", "\n", " ", - RowBox[{ - RowBox[{"{", - RowBox[{"dl1", ",", "dl2", ",", "dl3", ",", "dl4"}], "}"}], "=", - RowBox[{"DualLinearProgramming", "[", - RowBox[{"obf", ",", "cmat1", ",", "bvect", ",", "bds"}], "]"}]}], ";", - "\n", " ", - RowBox[{"res", "=", - RowBox[{"Take", "[", - RowBox[{"dl1", ",", - RowBox[{"-", - RowBox[{"Length", "[", "T", "]"}]}]}], "]"}]}], ";", "\n", " ", - RowBox[{"If", "[", + RowBox[{"{", RowBox[{ + "dmQ", ",", "cl2", ",", "ci", ",", "cdi", ",", "xd3", ",", "cd1", ",", + "pcd1", ",", "ptk", ",", "cd4a", ",", "cd4b", ",", "cd4", ",", "pcd4", + ",", "pcd4b", ",", "tk", ",", "tkl", ",", "tk2", ",", "ch", ",", + "cd2", ",", "cd2a", ",", "cd2b", ",", "tc", ",", "cd3a", ",", "cd3b", + ",", "cd3", ",", "ccik", ",", "pstrQ", ",", "cik", ",", "ext", ",", + "sl1", ",", "sl2", ",", "rl1", ",", "rl2", ",", "rl3", ",", "its", + ",", "cmp", ",", "pk", ",", "svl", ",", "cl"}], "}"}], ",", "\n", + " ", + RowBox[{ + RowBox[{"dmQ", "=", RowBox[{"SameQ", "[", RowBox[{ - RowBox[{"dl1", "[", - RowBox[{"[", "1", "]"}], "]"}], ",", "Indeterminate"}], "]"}], ",", - RowBox[{"Return", "[", "res", "]"}]}], "]"}], ";", "\n", " ", - RowBox[{"gr", "=", - RowBox[{ + RowBox[{"2", "^", + RowBox[{"Length", "[", "T", "]"}]}], ",", + RowBox[{"2", "^", "3"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"If", "[", + RowBox[{"dmQ", ",", "True", ",", + RowBox[{ + RowBox[{ + "Print", "[", "\"\\"", "]"}], ";", + RowBox[{"Return", "[", "]"}]}]}], "]"}], ";", "\n", " ", + RowBox[{"cl2", "=", + RowBox[{"Drop", "[", + RowBox[{ + RowBox[{"Take", "[", + RowBox[{ + RowBox[{"Subsets", "[", "T", "]"}], ",", + RowBox[{"-", "4"}]}], "]"}], ",", + RowBox[{"-", "1"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"ci", "=", RowBox[{ - RowBox[{"Greater", "[", - RowBox[{"#", ",", "0"}], "]"}], " ", "&"}], "/@", " ", "dl2"}]}], - ";", "\n", " ", - RowBox[{"ps", " ", "=", " ", - RowBox[{"Flatten", "[", - RowBox[{"Position", "[", - RowBox[{"gr", ",", "True"}], "]"}], "]"}]}], ";", "\n", " ", - RowBox[{"al1", " ", "=", " ", - RowBox[{ + RowBox[{ + RowBox[{"Cases", "[", + RowBox[{"cl2", ",", + RowBox[{"{", + RowBox[{"___", ",", "#", ",", "___"}], "}"}]}], "]"}], " ", + "&"}], "/@", " ", "T"}]}], ";", "\n", " ", + RowBox[{"cdi", "=", RowBox[{ - RowBox[{"First", "[", "#", "]"}], " ", "&"}], "/@", " ", "cmat"}]}], - ";", "\n", " ", - RowBox[{"psal1", " ", "=", " ", - RowBox[{"Flatten", "[", - RowBox[{"Position", "[", - RowBox[{"al1", ",", "0"}], "]"}], "]"}]}], ";", " ", "\n", " ", - RowBox[{"ps", " ", "=", " ", - RowBox[{"Complement", "[", - RowBox[{"ps", ",", "psal1"}], "]"}]}], ";", "\n", " ", - RowBox[{"If", "[", + RowBox[{ + RowBox[{"DeleteCases", "[", + RowBox[{"cl2", ",", + RowBox[{"{", + RowBox[{"___", ",", "#", ",", "___"}], "}"}]}], "]"}], " ", + "&"}], "/@", " ", "T"}]}], ";", "\n", " ", + RowBox[{"xd3", "=", + RowBox[{ + RowBox[{ + RowBox[{"First", "[", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "+", " ", "#"}], ")"}], "/", + "3"}], "]"}], " ", "&"}], "/@", " ", + RowBox[{"MapThread", "[", + RowBox[{ + RowBox[{ + RowBox[{"Subtract", "[", + RowBox[{"#1", ",", "#2"}], "]"}], " ", "&"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Total", "[", + RowBox[{"Map", "[", + RowBox[{"v", ",", "#"}], "]"}], "]"}], " ", "&"}], "/@", " ", + "ci"}], ",", + RowBox[{ + RowBox[{ + RowBox[{"2", "*", + RowBox[{"Map", "[", + RowBox[{"v", ",", "#"}], "]"}]}], " ", "&"}], "/@", " ", + "cdi"}]}], "}"}]}], "]"}]}]}], ";", "\n", " ", + RowBox[{"(*", " ", + RowBox[{"Defining", " ", "Cases"}], " ", "*)"}], "\n", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"CoreQ", "[", "game", "]"}], ",", "False"}], "]"}], ",", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", "xd3"}], ",", + "\n", " ", + RowBox[{ + RowBox[{"cd1", "=", + RowBox[{ + RowBox[{ + RowBox[{"GreaterEqual", "[", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], ",", + RowBox[{"3", "*", + RowBox[{"v", "[", "#", "]"}]}]}], "]"}], " ", "&"}], "/@", + " ", "cl2"}]}], ";", "\n", " ", + RowBox[{"pcd1", "=", + RowBox[{"Position", "[", + RowBox[{"cd1", ",", "False"}], "]"}]}], ";", "\n", " ", + RowBox[{"ptk", "=", + RowBox[{"Extract", "[", + RowBox[{"cl2", ",", "pcd1"}], "]"}]}], ";", "\n", " ", + RowBox[{"cd4a", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Total", "[", + RowBox[{"2", "*", + RowBox[{"v", "[", "#", "]"}]}], "]"}], " ", "&"}], "/@", " ", + RowBox[{"DeleteCases", "[", + RowBox[{"cl2", ",", "#"}], "]"}]}], " ", "&"}], "/@", " ", + "cl2"}]}], ";", "\n", " ", + RowBox[{"cd4b", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "T", "]"}], "+", + RowBox[{"v", "[", "#", "]"}]}], " ", "&"}], "/@", " ", + "cl2"}]}], ";", "\n", " ", + RowBox[{"cd4", "=", + RowBox[{"MapThread", "[", + RowBox[{ + RowBox[{ + RowBox[{"GreaterEqual", "[", + RowBox[{"#1", ",", "#2"}], "]"}], " ", "&"}], ",", + RowBox[{"{", + RowBox[{"cd4b", ",", + RowBox[{ + RowBox[{ + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], "/@", " ", + "cd4a"}]}], "}"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"pcd4", "=", + RowBox[{"Extract", "[", + RowBox[{"cl2", ",", + RowBox[{"Position", "[", + RowBox[{"cd4", ",", "True"}], "]"}]}], "]"}]}], ";", "\n", + " ", + RowBox[{"tk2", "=", + RowBox[{"Extract", "[", + RowBox[{"cl2", ",", + RowBox[{"Position", "[", + RowBox[{"cd1", ",", "False"}], "]"}]}], "]"}]}], ";", "\n", + " ", + RowBox[{"tkl", " ", "=", " ", + RowBox[{"Which", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"tk2", ",", " ", + RowBox[{"{", "}"}]}], "]"}], ",", " ", + RowBox[{"{", "}"}], ",", "\n", " ", + RowBox[{"SameQ", "[", + RowBox[{"pcd4", ",", " ", + RowBox[{"{", "}"}]}], "]"}], ",", " ", + RowBox[{"{", "}"}], ",", "\n", " ", "True", ",", + " ", + RowBox[{"First", "[", + RowBox[{"Intersection", "[", + RowBox[{"tk2", ",", " ", "pcd4"}], "]"}], "]"}]}], "]"}]}], + ";", "\n", " ", + RowBox[{"ch", "=", + RowBox[{"Cases", "[", + RowBox[{"ci", ",", + RowBox[{"{", + RowBox[{"___", ",", "tkl", ",", "___"}], "}"}]}], "]"}]}], ";", + "\n", " ", + RowBox[{"tc", "=", + RowBox[{ + RowBox[{ + RowBox[{"First", "[", + RowBox[{"Complement", "[", + RowBox[{"#", ",", + RowBox[{"{", "tkl", "}"}]}], "]"}], "]"}], " ", "&"}], "/@", + " ", "ch"}]}], ";", "\n", " ", + RowBox[{"cd2", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"MapThread", "[", + RowBox[{ + RowBox[{ + RowBox[{"GreaterEqual", "[", + RowBox[{"#1", ",", "#2"}], "]"}], " ", "&"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"v", "[", "T", "]"}], "}"}], ",", "#"}], "}"}]}], + "]"}], " ", "&"}], "/@", " ", "#"}], " ", "&"}], "/@", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "+", " ", + RowBox[{"2", "*", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "&"}], "/@", " ", + RowBox[{"DeleteCases", "[", + RowBox[{"cl2", ",", + RowBox[{"{", + RowBox[{"___", ",", "#", ",", "___"}], "}"}]}], "]"}]}], + " ", "&"}], "/@", " ", "#"}], ")"}]}]}], " ", "&"}], "/@", + " ", "cl2"}], ")"}]}]}], ";", "\n", " ", + RowBox[{"cd2a", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", ">=", " ", + RowBox[{ + RowBox[{"v", "[", "tkl", "]"}], " ", "+", " ", + RowBox[{"2", "*", + RowBox[{"v", "[", "#", "]"}]}]}]}], " ", "&"}], "/@", " ", + "tc"}]}], ";", "\n", " ", + RowBox[{"cd2b", "=", + RowBox[{"Apply", "[", + RowBox[{"Or", ",", "cd2a"}], "]"}]}], ";", "\n", " ", + RowBox[{"cd3a", "=", + RowBox[{ + RowBox[{ + RowBox[{"GreaterEqual", "[", + RowBox[{ + RowBox[{"v", "[", "tkl", "]"}], ",", "#"}], "]"}], " ", "&"}], + "/@", " ", + RowBox[{"Map", "[", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], "&"}], ",", " ", "tc"}], + "]"}]}]}], ";", "\n", " ", + RowBox[{"cd3b", "=", + RowBox[{"Position", "[", + RowBox[{"cd3a", ",", "True"}], "]"}]}], ";", "\n", " ", + RowBox[{"cd3", "=", + RowBox[{"SameQ", "[", + RowBox[{"cd3b", ",", + RowBox[{"{", "}"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"pstrQ", "=", + RowBox[{"Position", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"Or", ",", + RowBox[{"Flatten", "[", "#", "]"}]}], "]"}], " ", "&"}], "/@", + " ", "cd2"}], ",", "True"}], "]"}]}], ";", "\n", " ", + RowBox[{"cik", " ", "=", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"pstrQ", ",", " ", + RowBox[{"{", "}"}]}], "]"}], ",", " ", + RowBox[{"First", "[", + RowBox[{"DeleteCases", "[", + RowBox[{"ci", ",", " ", + RowBox[{"{", + RowBox[{"___", ",", " ", "tkl", ",", " ", "___"}], "}"}]}], + "]"}], "]"}], ",", " ", + RowBox[{ + RowBox[{"Extract", "[", + RowBox[{"ci", ",", " ", "pstrQ"}], "]"}], " ", "//", " ", + "First"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"(*", + RowBox[{ + "Assigning", " ", "Payoffs", " ", "to", " ", "the", " ", + "Players"}], " ", "*)"}], "\n", " ", + RowBox[{"Which", "[", + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"And", ",", "cd1"}], "]"}], ",", "\n", + " ", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", + RowBox[{"Array", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "T", "]"}], "/", "3"}], " ", "&"}], ",", + "3"}], "]"}]}], ",", "\n", " ", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"Or", ",", "cd1"}], "]"}], ",", "True"}], "]"}], " ", + "&&", " ", + RowBox[{"Apply", "[", + RowBox[{"And", ",", " ", "cd2a"}], "]"}]}], ",", "\n", + " ", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", "\n", + " ", + RowBox[{"ext", "=", + RowBox[{"Extract", "[", + RowBox[{"cl2", ",", "pcd1"}], "]"}]}], ";", "\n", + " ", + RowBox[{"sl1", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "+", " ", + RowBox[{"v", "[", "#", "]"}]}], ")"}], "/", "4"}], " ", + "&"}], "/@", " ", "ext"}]}], ";", "\n", " ", + RowBox[{"sl2", "=", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "-", " ", + RowBox[{"v", "[", "#", "]"}]}], ")"}], "/", "2"}], " ", + "&"}], "/@", " ", "ext"}]}], ";", "\n", " ", + RowBox[{"rl1", "=", + RowBox[{ + RowBox[{ + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"{", "#", "}"}], ",", "sl1"}], "}"}]}], "]"}], + " ", "&"}], "/@", " ", + RowBox[{"Flatten", "[", "ext", "]"}]}]}], ";", "\n", + " ", + RowBox[{"rl2", "=", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"Complement", "[", + RowBox[{"T", ",", + RowBox[{"Flatten", "[", "ext", "]"}]}], "]"}], ",", + "sl2"}], "}"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"T", " ", "/.", " ", + RowBox[{"Flatten", "[", + RowBox[{"AppendTo", "[", + RowBox[{"rl1", ",", "rl2"}], "]"}], "]"}]}]}], ",", "\n", + " ", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"cd3", ",", "False"}], "]"}], " ", "&&", " ", + RowBox[{"SameQ", "[", + RowBox[{"cd2b", ",", "True"}], "]"}]}], ",", "\n", "\t ", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", "\n", + " ", + RowBox[{"ptk", " ", "=", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{ + RowBox[{"Length", "[", "ptk", "]"}], " ", "==", " ", "1"}], + ",", "\n", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{ + RowBox[{"Length", "[", "pcd4", "]"}], " ", "==", " ", + "1"}], ",", "\n", " ", + RowBox[{ + RowBox[{"pcd4b", " ", "=", " ", + RowBox[{"Extract", "[", + RowBox[{"cl2", ",", " ", + RowBox[{"Position", "[", + RowBox[{"cd4", ",", " ", "False"}], "]"}]}], "]"}]}], ";", + "\n", " ", + RowBox[{"svl", " ", "=", " ", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "pcd4b"}]}], ";", "\n", " ", + RowBox[{"cl", " ", "=", " ", + RowBox[{"First", "[", + RowBox[{"Extract", "[", + RowBox[{"pcd4b", ",", " ", + RowBox[{"Position", "[", + RowBox[{"svl", ",", " ", + RowBox[{"Max", "[", "svl", "]"}]}], "]"}]}], "]"}], + "]"}]}], ";", "\n", " ", + RowBox[{"{", + RowBox[{"cl", ",", " ", "tkl"}], "}"}]}], " ", ",", " ", + "pcd4"}], "]"}], ",", " ", "ptk"}], "]"}]}], ";", "\n", + " ", + RowBox[{"(*", " ", + RowBox[{ + RowBox[{"ptk", " ", "=", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{ + RowBox[{"Length", "[", "ptk", "]"}], " ", "==", " ", "1"}], + ",", " ", "pcd4", ",", " ", "ptk"}], "]"}]}], ";"}], " ", + "*)"}], "\n", " ", + RowBox[{"its", "=", + RowBox[{"Apply", "[", + RowBox[{"Intersection", ",", "ptk"}], "]"}]}], ";", "\n", + " ", + RowBox[{"rl1", "=", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{"its", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"Total", "[", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "&"}], "/@", " ", + "ptk"}], "]"}], "/", "2"}], "}"}]}], "}"}]}], "]"}]}], + ";", "\n", " ", + RowBox[{"cmp", "=", + RowBox[{"Complement", "[", + RowBox[{"tkl", ",", "its"}], "]"}]}], ";", "\n", + " ", + RowBox[{"ccik", "=", + RowBox[{"Complement", "[", + RowBox[{"ptk", ",", + RowBox[{"{", "tkl", "}"}]}], "]"}]}], ";", "\n", + " ", + RowBox[{"rl2", "=", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{"cmp", ",", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "-", " ", + RowBox[{"v", "[", "#", "]"}]}], ")"}], "/", "2"}], " ", + "&"}], "/@", " ", "ccik"}]}], "}"}]}], "]"}]}], ";", "\n", + " ", + RowBox[{"rl3", "=", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"Complement", "[", + RowBox[{"T", ",", "tkl"}], "]"}], ",", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "-", " ", + RowBox[{"v", "[", "tkl", "]"}]}], ")"}], "/", "2"}], + "}"}]}], "}"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"T", " ", "/.", " ", + RowBox[{"Flatten", "[", + RowBox[{"{", + RowBox[{"rl1", ",", " ", "rl2", ",", " ", "rl3"}], "}"}], + "]"}]}]}], ",", "\n", " ", + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"Or", ",", "cd4"}], "]"}], " ", "&&", " ", + RowBox[{"SameQ", "[", + RowBox[{"cd2b", ",", "False"}], "]"}]}], ",", "\n", + " ", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", "\n", + " ", + RowBox[{"pk", "=", + RowBox[{"Complement", "[", + RowBox[{"T", ",", "tkl"}], "]"}]}], ";", "\n", + " ", + RowBox[{"its", "=", + RowBox[{ + RowBox[{"First", "[", "tkl", "]"}], " ", "//", "List"}]}], ";", + "\n", " ", + RowBox[{"rl2", " ", "=", " ", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{"its", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "+", " ", + RowBox[{"v", "[", "tkl", "]"}], " ", "+", " ", + RowBox[{"2", "*", + RowBox[{"Apply", "[", + RowBox[{"Subtract", ",", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "&"}], "/@", " ", + "tc"}]}], "]"}]}]}], ")"}], "/", "4"}], "}"}]}], "}"}]}], + "]"}]}], ";", "\n", " ", + RowBox[{"cmp", "=", + RowBox[{ + RowBox[{"Last", "[", "tkl", "]"}], " ", "//", "List"}]}], ";", + "\n", " ", + RowBox[{"rl1", " ", "=", " ", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{"cmp", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "+", " ", + RowBox[{"v", "[", "tkl", "]"}], " ", "-", " ", + RowBox[{"2", "*", + RowBox[{"Apply", "[", + RowBox[{"Subtract", ",", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "&"}], "/@", " ", + "tc"}]}], "]"}]}]}], ")"}], "/", "4"}], "}"}]}], "}"}]}], + "]"}]}], ";", "\n", " ", + RowBox[{"rl3", "=", + RowBox[{"MapThread", "[", + RowBox[{"Rule", ",", + RowBox[{"{", + RowBox[{"pk", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "-", " ", + RowBox[{"v", "[", "tkl", "]"}]}], ")"}], "/", "2"}], + "}"}]}], "}"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"T", " ", "/.", " ", + RowBox[{"Flatten", "[", + RowBox[{"{", + RowBox[{"rl1", ",", " ", "rl2", ",", " ", "rl3"}], "}"}], + "]"}]}]}], ",", "\n", " ", "True", ",", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", "xd3"}]}], + "\n", " ", "]"}]}]}], "\n", " ", "]"}]}]}], "\n", + " ", "]"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{"(*", " ", "\n", " ", + RowBox[{ + RowBox[{ + RowBox[{ + "The", " ", "next", " ", "function", " ", "translates", " ", "the", " ", + "definition", " ", "of", " ", "the", " ", "Nucleolus", " ", "into", + "\n", " ", "a", " ", "sequence", " ", "of", " ", "linear", " ", + "programs", " ", "on", " ", "the", " ", "pre"}], "-", + RowBox[{"imputation", " ", + RowBox[{"set", ".", " ", "\n", " ", "To"}], " ", "obtain", " ", "a", + " ", "pre"}], "-", + RowBox[{ + "kernel", " ", "solution", " ", "the", " ", "recursion", " ", + "stops"}]}], ",", " ", + RowBox[{"in", " ", "general"}], ",", " ", + RowBox[{ + "before", "\n", " ", "the", " ", "nucleolus", " ", "of", " ", "the", " ", + "game", " ", "has", " ", "been", " ", + RowBox[{"computed", ".", " ", "One"}], " ", "stopping", " ", "criterion", + " ", "of", " ", "\n", " ", "the", " ", "recursion", " ", "procedure", + " ", "is", " ", "if", " ", "the", " ", "set", " ", "of", " ", "new", " ", + "equal", " ", "constraints", " ", "is", " ", + RowBox[{"empty", ".", " ", "\n", " ", "C", ".", "f", ".", " ", "Owen"}], + " ", "1974", " ", "and", " ", "Owen", " ", + RowBox[{"(", + RowBox[{"1995", ",", " ", + RowBox[{ + RowBox[{"pp", ".322"}], "-", "334."}]}], ")"}]}]}], "\n", + "*)"}]}]}], "Code",ExpressionUUID->"3f3fb262-e9de-43ea-b1fa-742c0fa63807"], + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"SeqLP", "[", + RowBox[{ + "obf_", ",", " ", "cmat_List", ",", " ", "bvect_List", ",", "bds_List", + ",", + RowBox[{"bA_", ":", + RowBox[{"{", "}"}]}]}], "]"}], " ", ":=", "\n", " ", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", + RowBox[{ + "cmat1", ",", "dl1", ",", "dl2", ",", "dl3", ",", "dl4", ",", "res", + ",", "rl2", ",", "const01", ",", "const02", ",", "const", ",", "gr", + ",", "ps", ",", "al1", ",", "psal1", ",", "ov", ",", "ps1", ",", "zv", + ",", "rl", ",", "bA1", ",", "lb", ",", "bA2", ",", "ons", ",", "wghs", + ",", "mr", ",", "pw", ",", "pwQ", ",", "extb", ",", "bvect1", ",", + "twv", ",", "ps2", ",", "rl3", ",", "zQ"}], "}"}], ",", "\n", " ", + RowBox[{ + RowBox[{"cmat1", "=", + RowBox[{"SparseArray", "[", "cmat", "]"}]}], ";", "\n", " ", + RowBox[{ + RowBox[{"{", + RowBox[{"dl1", ",", "dl2", ",", "dl3", ",", "dl4"}], "}"}], "=", + RowBox[{"DualLinearProgramming", "[", + RowBox[{"obf", ",", "cmat1", ",", "bvect", ",", "bds"}], "]"}]}], ";", + "\n", " ", + RowBox[{"res", "=", + RowBox[{"Take", "[", + RowBox[{"dl1", ",", + RowBox[{"-", + RowBox[{"Length", "[", "T", "]"}]}]}], "]"}]}], ";", "\n", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"dl1", "[", + RowBox[{"[", "1", "]"}], "]"}], ",", "Indeterminate"}], "]"}], ",", + RowBox[{"Return", "[", "res", "]"}]}], "]"}], ";", "\n", " ", + RowBox[{"gr", "=", + RowBox[{ + RowBox[{ + RowBox[{"Greater", "[", + RowBox[{"#", ",", "0"}], "]"}], " ", "&"}], "/@", " ", "dl2"}]}], + ";", "\n", " ", + RowBox[{"ps", " ", "=", " ", + RowBox[{"Flatten", "[", + RowBox[{"Position", "[", + RowBox[{"gr", ",", "True"}], "]"}], "]"}]}], ";", "\n", " ", + RowBox[{"al1", " ", "=", " ", + RowBox[{ + RowBox[{ + RowBox[{"First", "[", "#", "]"}], " ", "&"}], "/@", " ", "cmat"}]}], + ";", "\n", " ", + RowBox[{"psal1", " ", "=", " ", + RowBox[{"Flatten", "[", + RowBox[{"Position", "[", + RowBox[{"al1", ",", "0"}], "]"}], "]"}]}], ";", " ", "\n", " ", + RowBox[{"ps", " ", "=", " ", + RowBox[{"Complement", "[", + RowBox[{"ps", ",", "psal1"}], "]"}]}], ";", "\n", " ", + RowBox[{"If", "[", RowBox[{ RowBox[{"SameQ", "[", RowBox[{"ps", ",", @@ -8154,7 +9018,7 @@ Cell[BoxData[ RowBox[{"SeqLP", "[", RowBox[{"obf", ",", "cmat1", ",", "bvect1", ",", "bds", ",", "bA2"}], "]"}]}], "]"}]}]}], " ", "\n", "]"}]}], ";"}]], "Code",ExpressionUUI\ -D->"055de238-0718-42c2-8fcd-622779b9f379"], +D->"36a9aa0a-a11a-4ecd-8bc1-2bb9aca3d337"], Cell[BoxData[ RowBox[{ @@ -8163,7 +9027,7 @@ Cell[BoxData[ RowBox[{ "game_", ",", "obf_", ",", " ", "cmat_List", ",", " ", "bvect_List", ",", "bds_List", ",", - RowBox[{"bA_:", + RowBox[{"bA_", ":", RowBox[{"{", "}"}]}]}], "]"}], " ", ":=", "\n", " ", RowBox[{"Block", "[", RowBox[{ @@ -8356,7 +9220,7 @@ Cell[BoxData[ RowBox[{ "game", ",", "obf", ",", "cmat1", ",", "bvect1", ",", "bds", ",", "bA2"}], "]"}]}], "]"}]}]}], " ", "\n", "]"}]}], ";"}]], "Code",Expr\ -essionUUID->"13f50bea-961c-4c4c-922c-b2aaec736319"], +essionUUID->"298a643a-08b8-46b1-8499-cfe4133eb4c9"], Cell[BoxData[ RowBox[{ @@ -8391,7 +9255,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"LSPreNuc", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -8524,7 +9388,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"LSNuc", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -8615,8 +9479,8 @@ Cell[BoxData[ RowBox[{"fLSnc", "[", RowBox[{"py", ",", "cM", ",", "mM", ",", "lt"}], "]"}]}]}], "\n", "\t\t ", "]"}]}]}], " ", "\n", "\t\t ", "\n", "\n", "\t ", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"9c12d51e-b645-4d54-be22-\ -75df1296e4cb"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"77086b5f-df97-47b3-a8a4-\ +f58a7873aab1"], Cell[BoxData[ RowBox[{ @@ -8624,7 +9488,7 @@ Cell[BoxData[ RowBox[{"fLSnc", "[", RowBox[{"pyf_List", ",", "cmpM_List", ",", "stM_List", ",", "n_"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -8713,7 +9577,7 @@ Cell[BoxData[ RowBox[{"fLSnc", "[", RowBox[{"py", ",", "cM", ",", "nM", ",", "n"}], "]"}]}], "]"}]}]}], "\t\t\t\t ", "\n", "\n", "\t ", "]"}]}], ";"}]], "Code",ExpressionUUI\ -D->"3a68086e-1c4e-4bc5-b3f7-95020ef8a4fd"], +D->"e26fa1d3-ddfa-45e0-a268-41a6c7633955"], Cell[BoxData[ RowBox[{ @@ -8742,12 +9606,12 @@ Cell[BoxData[ RowBox[{ RowBox[{"FTPreNuc", "[", RowBox[{"game_", ",", - RowBox[{"tol_:", + RowBox[{"tol_", ":", RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "2"}], ")"}]}]}], ",", - RowBox[{"jj_:", "2"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"jj_", ":", "2"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -8889,7 +9753,7 @@ Cell[BoxData[ RowBox[{"game", ",", "tol1", ",", "jj", ",", "mcl", ",", "vars"}], "]"}]}], "\n", "\t\t\t ", "]"}]}], "\n", "\t\t ", "]"}]}]}], "\n", "\t\t\t\t\t ", "]"}]}], ";"}]}]], "Code",ExpressionUUID->\ -"3554978c-ede9-47ad-88cc-a4b0fd96b01e"], +"00d8ceba-ad8d-4649-ae20-440e1aaaf420"], Cell[BoxData[ RowBox[{ @@ -8899,7 +9763,7 @@ Cell[BoxData[ RowBox[{ "game_", ",", "tol_", ",", "jj_", ",", "iim_List", ",", "xvars_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "lsg", "}"}], ",", "\n", " ", RowBox[{ @@ -8926,14 +9790,14 @@ Cell[BoxData[ RowBox[{"Return", "[", "$Failed", "]"}], ",", RowBox[{"xvars", " ", "/.", " ", "lsg"}]}], "]"}]}], "]"}]}]}], "\n", "\t\t\t\t\t ", "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->\ -"4cf65e7b-7663-444c-8db9-697dd6024a58"], +"6553b23c-0a13-4f24-884b-f9231324283d"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"FTCoalArray", "[", RowBox[{"game_", ",", "payoff_", ",", "tol_"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -8965,7 +9829,7 @@ Cell[BoxData[ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}]}], "]"}]}]}], "\n", "\t\t\t\t ", "]"}]}], - ";"}]], "Code",ExpressionUUID->"a0259bcf-f7f1-44e6-8de2-3ba66fff9abc"], + ";"}]], "Code",ExpressionUUID->"147287c5-5ec3-4c1a-bd33-8332e5d91c71"], Cell[BoxData[ RowBox[{ @@ -8982,15 +9846,15 @@ Cell[BoxData[ RowBox[{ RowBox[{"PnSelectFTMCR", "[", RowBox[{"exc_List", ",", "sC_", ",", "lt_", ",", "tol_", ",", - RowBox[{"pIk_:", + RowBox[{"pIk_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"plIk_:", + RowBox[{"plIk_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"pslex_:", + RowBox[{"pslex_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"blQ_:", "True"}], ",", - RowBox[{"mtrk_:", "0"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"blQ_", ":", "True"}], ",", + RowBox[{"mtrk_", ":", "0"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9105,8 +9969,8 @@ Cell[BoxData[ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}]}], "}"}]}], "\n", "\t\t ", "]"}]}], "\n", "\t\t", "]"}]}]}], "\n", "\t\t\t\t\t\t\t ", "]"}]}], ";"}], "\n", - "\n", "\n", "\n"}]}]], "Code",ExpressionUUID->"eb7c0fb7-46c0-43aa-b01a-\ -c959f968db34"], + "\n", "\n", "\n"}]}]], "Code",ExpressionUUID->"538e4e81-ec0c-4ea2-be70-\ +acfb0949557a"], Cell[BoxData[ RowBox[{ @@ -9132,19 +9996,19 @@ Cell[BoxData[ " ", "pre"}], "-", RowBox[{"nucleolus", " ", RowBox[{"too", "."}]}]}]}], "\n", "\n", "*)"}], " "}]], "Code",Express\ -ionUUID->"59baca7b-6c67-4c6f-bd34-747c1f15f144"], +ionUUID->"d90ce4f9-bd2c-482b-9d25-1dfc42d6ccd4"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"NonLinPreNuc", "[", RowBox[{"game_", ",", "p_", ",", "k_", ",", - RowBox[{"tol_:", + RowBox[{"tol_", ":", RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "2"}], ")"}]}]}], ",", - RowBox[{"jj_:", "2"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"jj_", ":", "2"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9229,8 +10093,8 @@ Cell[BoxData[ "game", ",", "p", ",", "k", ",", "tol1", ",", "jj", ",", "mcl", ",", "vars"}], "]"}]}], "\n", "\t\t\t ", "]"}]}], "\n", "\t\t ", "]"}]}]}], "\n", "\t\t\t\t\t\t\t\t\t ", "\n", - "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"e38deede-c9cb-\ -4307-8a6f-cb7feab5354f"], + "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"23550718-7e81-\ +4c2e-bb1b-585a87b55dda"], Cell[BoxData[ RowBox[{ @@ -9239,7 +10103,7 @@ Cell[BoxData[ RowBox[{ "game_", ",", "p_", ",", "k_", ",", "tol_", ",", "jj_", ",", "iim_List", ",", "xvars_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "lsg", "}"}], ",", "\n", " ", RowBox[{ @@ -9265,20 +10129,20 @@ Cell[BoxData[ RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"Return", "[", "$Failed", "]"}], ",", RowBox[{"xvars", " ", "/.", " ", "lsg"}]}], "]"}]}], "]"}]}]}], - "\n", "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"b95e41f6-\ -c9ad-4dc9-aae1-a10d00c513d8"], + "\n", "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"99733a63-\ +c8ae-4060-bc9f-7a698998475d"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"NonLinNuc", "[", RowBox[{"game_", ",", "p_", ",", "k_", ",", - RowBox[{"tol_:", + RowBox[{"tol_", ":", RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "2"}], ")"}]}]}], ",", - RowBox[{"jj_:", "2"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"jj_", ":", "2"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sar", ",", "vars", ",", "xpk", ",", "mcl", ",", "tol1"}], @@ -9320,7 +10184,7 @@ Cell[BoxData[ RowBox[{ "game", ",", "p", ",", "k", ",", "tol1", ",", "jj", ",", "mcl", ",", "vars"}], "]"}]}], "]"}]}]}], "\n", "\t\t\t\t\t ", "]"}]}], - ";"}]], "Code",ExpressionUUID->"af3034b4-4640-40a0-9cfb-437330fd521f"], + ";"}]], "Code",ExpressionUUID->"821c7117-a22c-48de-8bf3-e868c28ed305"], Cell[BoxData[ RowBox[{ @@ -9329,7 +10193,7 @@ Cell[BoxData[ RowBox[{ "game_", ",", "p_", ",", "k_", ",", "tol_", ",", "jj_", ",", "iim_List", ",", "xvars_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "lsg", "}"}], ",", "\n", " ", RowBox[{ @@ -9355,8 +10219,8 @@ Cell[BoxData[ RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"Return", "[", "$Failed", "]"}], ",", RowBox[{"xvars", " ", "/.", " ", "lsg"}]}], "]"}]}], "]"}]}]}], - "\n", "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"5ce158f1-\ -cd24-4e32-ab19-56c69a74090c"], + "\n", "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"373cb6ab-\ +5160-4f8e-84d9-24a5605d8b5c"], Cell[BoxData[ RowBox[{ @@ -9365,7 +10229,7 @@ Cell[BoxData[ RowBox[{ "game_", ",", "p_", ",", "k_", ",", "tol_", ",", "jj_", ",", "iim_List", ",", "xvars_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "lsg", "}"}], ",", "\n", " ", RowBox[{ @@ -9391,8 +10255,8 @@ Cell[BoxData[ RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"Return", "[", "$Failed", "]"}], ",", RowBox[{"xvars", " ", "/.", " ", "lsg"}]}], "]"}]}], "]"}]}]}], - "\n", "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"8f66685c-\ -0c84-4ae0-9e27-d3d08489cd4c"], + "\n", "\t\t\t\t\t ", "]"}]}], ";"}]], "Code",ExpressionUUID->"6f9b49f0-\ +e9b6-4e89-baf9-3c07d4017770"], Cell[BoxData[{ RowBox[{ @@ -9400,7 +10264,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"FindSolX", "[", RowBox[{"ssz_List", ",", "vars_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sys", ",", "eqsys"}], "}"}], ",", "\n", "\t\t\t ", @@ -9435,10 +10299,10 @@ Cell[BoxData[{ RowBox[{ RowBox[{"SolveSys", "[", RowBox[{"bsys_List", ",", "iim_List", ",", "exc_List", ",", - RowBox[{"glsys_:", + RowBox[{"glsys_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"idx_:", "1"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"idx_", ":", "1"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9521,7 +10385,7 @@ Cell[BoxData[{ RowBox[{"rsys", ",", "riim", ",", "rexc", ",", "nwgl", ",", RowBox[{"idx", "+", "1"}]}], "]"}]}], "\n", "\t\t ", "]"}]}]}], "\n", "\t\t ", "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->\ -"77f04d33-d200-4812-abed-9792d4ff9898"], +"fc4771fe-0991-4fd8-b6b1-6faab7f1613d"], Cell[BoxData[{ RowBox[{ @@ -9529,7 +10393,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"ApproxNuc", "[", RowBox[{"game_", ",", "p_", ",", "k_"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9570,9 +10434,8 @@ Cell[BoxData[{ " ", RowBox[{"obj", " ", "=", " ", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "pexc"}], "]"}], " ", "/.", " ", "rl"}]}], ";", - "\n", "\t\t\t", + RowBox[{"Total", "[", "pexc", "]"}], " ", "/.", " ", "rl"}]}], ";", + "\n", "\t\t\t", RowBox[{"vi", "=", RowBox[{ RowBox[{ @@ -9590,8 +10453,7 @@ Cell[BoxData[{ "\n", "\t\t\t", RowBox[{"eq", "=", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "vars"}], "]"}], "==", + RowBox[{"Total", "[", "vars", "]"}], "==", RowBox[{"v", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"AppendTo", "[", @@ -9614,11 +10476,11 @@ Cell[BoxData[{ RowBox[{ RowBox[{"ModCoalArray", "[", RowBox[{"game_", ",", "payoff_", ",", - RowBox[{"tol_:", + RowBox[{"tol_", ":", RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "7"}], ")"}]}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9688,7 +10550,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"PnModCoalArray", "[", RowBox[{"game_", ",", "payoff_", ",", "tol_"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sC", ",", "lt", ",", "excpay"}], "}"}], ",", "\n", " ", @@ -9718,7 +10580,7 @@ Cell[BoxData[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}]}], "]"}]}]}], "\n", "\t\t\t\t ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"b0a7a988-4d1c-4492-a298-4961138667e0"], + ";"}]}], "Code",ExpressionUUID->"c07080e1-63a6-4f9b-bfe1-4e07052575dd"], Cell[BoxData[{ RowBox[{ @@ -9726,15 +10588,15 @@ Cell[BoxData[{ RowBox[{ RowBox[{"SelectMCR", "[", RowBox[{"exc_List", ",", "sC_", ",", "lt_", ",", "tol_", ",", - RowBox[{"Ik_:", + RowBox[{"Ik_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"lIk_:", + RowBox[{"lIk_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"slex_:", + RowBox[{"slex_", ":", RowBox[{"{", "0", "}"}]}], ",", - RowBox[{"blQ_:", "False"}], ",", - RowBox[{"mtrk_:", "0"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"blQ_", ":", "False"}], ",", + RowBox[{"mtrk_", ":", "0"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9844,15 +10706,15 @@ Cell[BoxData[{ RowBox[{ RowBox[{"PnSelectMCR", "[", RowBox[{"exc_List", ",", "sC_", ",", "lt_", ",", "tol_", ",", - RowBox[{"pIk_:", + RowBox[{"pIk_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"plIk_:", + RowBox[{"plIk_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"pslex_:", + RowBox[{"pslex_", ":", RowBox[{"{", "}"}]}], ",", - RowBox[{"blQ_:", "False"}], ",", - RowBox[{"mtrk_:", "0"}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"blQ_", ":", "False"}], ",", + RowBox[{"mtrk_", ":", "0"}]}], "]"}], ":=", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -9959,8 +10821,8 @@ Cell[BoxData[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}]}], "}"}]}], "\n", "\t\t ", "]"}]}], "\n", "\t\t", "]"}]}]}], "\n", "\t\t\t\t\t\t\t ", "]"}]}], - ";"}], "\n"}], "Code",ExpressionUUID->"6abdba34-12b9-435f-ab75-\ -80efae01a235"], + ";"}], "\n"}], "Code",ExpressionUUID->"f698577e-31df-428b-9828-\ +99f72dfa2297"], Cell[BoxData[ RowBox[{ @@ -9971,7 +10833,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BalancedSelectionQ", "]"}]}]}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10114,14 +10976,14 @@ Cell[BoxData[ RowBox[{"\"\\"", ",", "balcQ"}], "]"}], ";"}], "*)"}], "\n", " ", RowBox[{"Return", "[", "balcQ", "]"}], ";"}]}], "\n", "]"}]}], ";"}], - "\n"}]], "Code",ExpressionUUID->"768e2ad1-bba8-4088-9f89-def9236d5106"], + "\n"}]], "Code",ExpressionUUID->"9151d9a6-4d6a-4459-92e5-c7ec1b002fdf"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ApproxPreNuc", "[", RowBox[{"game_", ",", "p_", ",", "k_"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10162,8 +11024,7 @@ Cell[BoxData[ " ", RowBox[{"obj", " ", "=", " ", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "pexc"}], "]"}], " ", "/.", " ", "rl"}]}], ";", + RowBox[{"Total", "[", "pexc", "]"}], " ", "/.", " ", "rl"}]}], ";", "\n", "\t\t\t", RowBox[{"ra", "=", RowBox[{"ReasonableOutcome", "[", "game", "]"}]}], ";", "\n", " ", @@ -10182,8 +11043,7 @@ Cell[BoxData[ " ", "\n", "\t\t\t", RowBox[{"eq", "=", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "vars"}], "]"}], "==", + RowBox[{"Total", "[", "vars", "]"}], "==", RowBox[{"v", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"AppendTo", "[", @@ -10192,8 +11052,8 @@ Cell[BoxData[ RowBox[{"NMinimize", "[", RowBox[{"obj", ",", RowBox[{"{", "const", "}"}], ",", "vars"}], "]"}]}]}], "\n", "\t\t\t", - "]"}]}], ";"}]], "Code",ExpressionUUID->"a8b4d09d-32b3-4151-acc1-\ -087d0ccf9886"], + "]"}]}], ";"}]], "Code",ExpressionUUID->"2aff29c5-4799-4341-ad5c-\ +7b8141c8f7c9"], Cell[BoxData[ RowBox[{ @@ -10203,7 +11063,7 @@ Cell[BoxData[ "This", " ", "section", " ", "is", " ", "designated", " ", "to", " ", "the", " ", "Modiclus", " ", "Modified", " ", "and", " ", "Proper", " ", "Modified", " ", "Pre"}], "-", "Kernel"}], " ", "*)"}], " "}]], "Code",Ex\ -pressionUUID->"bd0cc524-900b-4d58-bff5-d0475a4503dd"], +pressionUUID->"d589fbdc-b5e1-4f55-8377-8103b9754828"], Cell[BoxData[ RowBox[{ @@ -10235,7 +11095,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Modiclus", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10286,7 +11146,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"IsModiclusQ", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10330,7 +11190,7 @@ Cell[BoxData[ RowBox[{"Redefine", " ", "the", " ", "original", " ", RowBox[{"game", "."}]}], " ", "*)"}], "\n", " ", RowBox[{"Return", "[", "bcQ", "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"1995960e-3fa6-462d-a523-349d63f0cc27"], + ";"}]}]}]], "Code",ExpressionUUID->"c96f4d10-08dc-40e8-ba28-711f07e36de3"], Cell[BoxData[{ RowBox[{ @@ -10349,7 +11209,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ModPreKernel", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pay", "}"}], ",", "\n", " ", RowBox[{ @@ -10372,7 +11232,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ModPreKernel", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"dimpay", ",", "rclim"}], "}"}], ",", " ", "\n", " ", @@ -10451,7 +11311,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ModPreKernel", "]"}]}]}], "]"}], " ", ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10585,7 +11445,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ProperModPreKernel", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10624,7 +11484,7 @@ Cell[BoxData[{ RowBox[{"game", "."}]}], " ", "*)"}], "\n", " ", RowBox[{"Take", "[", RowBox[{"mdnc", ",", " ", "lt"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"99206110-52fd-4d3c-947c-26c3533317e3"], + ";"}]}], "Code",ExpressionUUID->"73fa0979-8b65-4577-a49c-3b744bc52801"], Cell[BoxData[{ RowBox[{ @@ -10635,7 +11495,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ProperModPreKernel", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10697,7 +11557,7 @@ Cell[BoxData[{ RowBox[{"IsModPreKernelQ", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10746,7 +11606,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"IsProperModPreKernelQ", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10806,7 +11666,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"DualExtension", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10880,7 +11740,7 @@ Cell[BoxData[{ "dlext"}]}], ";", "\n", " ", RowBox[{"{", RowBox[{"vals", ",", " ", "dlext"}], "}"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"da93dad5-4baf-4c01-8b35-f7f98047c7c6"], + ";"}]}], "Code",ExpressionUUID->"622316fc-ae74-4302-ad57-53752f536d70"], Cell[BoxData[ RowBox[{ @@ -10901,7 +11761,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"PrimalExtension", "[", "game_", "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -10987,7 +11847,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"DualCover", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11009,8 +11869,8 @@ Cell[BoxData[ RowBox[{"#1", ",", " ", "#2"}], "]"}], " ", "&"}], ",", " ", RowBox[{"{", RowBox[{"dvals", ",", " ", "pvals"}], "}"}]}], "]"}]}]}], "\n", - " ", "]"}]}], ";"}], "\n"}]}]], "Code",ExpressionUUID->"4c00f903-520b-\ -44d3-827f-b450f6723c88"], + " ", "]"}]}], ";"}], "\n"}]}]], "Code",ExpressionUUID->"e20a2305-e2fa-\ +4049-a374-7faada089dbf"], Cell[BoxData[{ RowBox[{ @@ -11018,7 +11878,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"ModECCoverGame", "[", RowBox[{"game_", ",", " ", "payoff_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11096,7 +11956,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"ECCoverGame", "[", RowBox[{"game_", ",", " ", "payoff_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11197,7 +12057,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"SMPreKernel", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11244,7 +12104,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"IsSMPreKernelQ", "[", RowBox[{"game_", ",", " ", "payoff_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11291,7 +12151,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"SMPrenucleolus", "[", "game_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11338,7 +12198,7 @@ Cell[BoxData[{ RowBox[{"IsSMPrenucleolusQ", "[", RowBox[{"game_", ",", " ", "payoff_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11374,7 +12234,7 @@ Cell[BoxData[{ RowBox[{"Redefine", " ", "the", " ", "original", " ", RowBox[{"game", "."}]}], "*)"}], "\n", " ", RowBox[{"Return", "[", "smpnQ", "]"}], ";"}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"4e014cb2-d7c1-4419-a9a6-11d6e2a24062"], + ";"}]}], "Code",ExpressionUUID->"03928180-a727-4a8c-bb17-cb1c4f7321af"], Cell[BoxData[ RowBox[{"(*", " ", @@ -11383,8 +12243,8 @@ Cell[BoxData[ "End", " ", "of", " ", "the", " ", "section", " ", "related", " ", "to", " ", "the", " ", "simplified", " ", "modified", " ", "pre"}], "-", RowBox[{"kernel", " ", "of", " ", "a", " ", - RowBox[{"game", "."}]}]}], " ", "*)"}]], "Code",ExpressionUUID->"3e8b90b0-\ -8461-4bbd-b17b-61ac2332a21b"], + RowBox[{"game", "."}]}]}], " ", "*)"}]], "Code",ExpressionUUID->"224ba2b4-\ +26d1-45f4-ae8c-e32c0c215ae4"], Cell[BoxData[ RowBox[{ @@ -11431,7 +12291,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BalancedSelectionQ", "]"}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"dimpay", ",", "cc"}], "}"}], ",", " ", "\n", " ", @@ -11491,8 +12351,8 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"bf5b1b18-879f-4d17-955f-\ -6a3c3c790fc3"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"f27caabd-e6b7-4f99-ac1a-\ +a92de1fbb8d3"], Cell[BoxData[ RowBox[{ @@ -11502,7 +12362,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BalancedSelectionQ", "]"}]}]}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11607,7 +12467,7 @@ Cell[BoxData[ RowBox[{ "balcQ", ",", " ", "wghvec", ",", " ", "sysvec", ",", " ", "selcoal"}], "}"}], ",", " ", "balcQ"}], "]"}]}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"aa35d79a-aeac-4e4e-82f7-d7b12daaf9c0"], + ";"}]], "Code",ExpressionUUID->"1aa5cf7c-ab32-45e0-ab29-214d9d3e8ce5"], Cell[BoxData[ RowBox[{ @@ -11617,7 +12477,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BalancedSelectionQ", "]"}]}]}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -11747,13 +12607,13 @@ Cell[BoxData[ RowBox[{"And", "[", RowBox[{"posQ", ",", " ", "oneQ"}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "balcQ", "]"}], ";"}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"e3a5dc11-6135-42ba-b6c1-afb05d17ac1c"], + ";"}]], "Code",ExpressionUUID->"3bfdef6b-f9f7-45a4-bd2f-f4243cf1a8fa"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{"Main", " ", "Function", " ", "related", " ", "to", " ", RowBox[{"BalancedSelctionQ", "[", "]"}]}], " ", "*)"}]], "Code",ExpressionU\ -UID->"efb80602-5324-4972-8c64-787423442757"], +UID->"f2b69b09-3f30-4cb9-9279-27cd81b6e42c"], Cell[BoxData[ RowBox[{ @@ -11763,7 +12623,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BalancedSelectionQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -12110,7 +12970,7 @@ Cell[BoxData[ RowBox[{ "balcQ", ",", " ", "newwghs", ",", " ", "balcmat", ",", " ", "selc"}], "}"}], ",", " ", "balcQ"}], "]"}]}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"0b6b0112-b903-45df-bc35-db3f3e2a2917"], + ";"}]], "Code",ExpressionUUID->"604776d5-ab93-488b-b9ab-3052bfbcbbe4"], Cell[BoxData[{ RowBox[{ @@ -12118,7 +12978,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"NewWghs", "[", RowBox[{"mat_List", ",", "wghs_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"poswghsQ", ",", "posQ", ",", " ", "newwghs"}], " ", "}"}], @@ -12164,7 +13024,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"NormMinimize", "[", RowBox[{"mat_List", ",", " ", "wghs_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -12245,7 +13105,7 @@ Cell[BoxData[{ RowBox[{"Rationalize", "[", RowBox[{"#", ",", "0.001"}], "]"}], " ", "&"}], " ", "/@", " ", "gw"}]}]}], "\n", "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->\ -"e3ae1fea-6e48-45b6-bb83-702e40830c0a"], +"847ae1ed-1b62-41f2-bf3e-48d3e41afdda"], Cell[BoxData[{ RowBox[{ @@ -12253,7 +13113,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"DetPosWeights", "[", RowBox[{"mat_List", ",", " ", "wghs_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -12264,8 +13124,7 @@ Cell[BoxData[{ RowBox[{"NullSpace", "[", RowBox[{"Transpose", "[", "mat", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"nlvec", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "nlsp"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "nlsp", "]"}]}], ";", "\n", " ", RowBox[{"nwghs01", " ", "=", " ", RowBox[{"wghs", " ", "+", " ", RowBox[{ @@ -12313,7 +13172,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "WeaklyBalancedSelectionQ", "]"}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -12363,8 +13222,8 @@ Cell[BoxData[{ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"9a4b4aa6-76ef-4db3-b797-\ -fd14aff2c24f"], + "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"e232fcbf-89f0-4d24-be08-\ +8137dbb5dcf7"], Cell[BoxData[ RowBox[{ @@ -12374,7 +13233,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "WeaklyBalancedSelectionQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -12567,7 +13426,7 @@ Cell[BoxData[ RowBox[{ "balcQ", ",", " ", "newwghs", ",", " ", "balcmat", ",", " ", "selc"}], "}"}], ",", " ", "balcQ"}], "]"}]}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"9f1451dd-37a8-4cbb-ba9a-5bfd06fea446"], + ";"}]], "Code",ExpressionUUID->"0cfb3e80-1141-4bbd-8d86-944617936a0a"], Cell[BoxData[{ RowBox[{ @@ -12575,7 +13434,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"NewWeakWghs", "[", RowBox[{"mat_List", ",", "wghs_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"poswghsQ", ",", "posQ", ",", " ", "newwghs"}], " ", "}"}], @@ -12622,7 +13481,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"WeakNormMinimize", "[", RowBox[{"mat_List", ",", " ", "wghs_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -12724,7 +13583,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"BalancedCollect", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"levexc", ",", " ", "redlev"}], "}"}], ",", "\n", " ", @@ -12773,7 +13632,7 @@ Cell[BoxData[{ RowBox[{"DetBalancedCollec", "[", RowBox[{"S_List", ",", " ", "payoff_List", ",", " ", "\[Alpha]_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"If", "[", @@ -12787,7 +13646,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"ConstVec", "[", "meff_List", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"zrv", ",", " ", "onesvec", ",", " ", "pscoal"}], "}"}], ",", @@ -12811,7 +13670,7 @@ Cell[BoxData[{ RowBox[{"ReplacePart", "[", RowBox[{"zrv", ",", " ", "1", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", " ", "pscoal"}]}]}], "\n", "]"}]}], ";"}], "\n"}], "Code",Ex\ -pressionUUID->"df643aa7-c742-4a13-81fe-3120537d63b3"], +pressionUUID->"5136f461-2fc8-47bb-9ab5-0afc1b128274"], Cell[BoxData[ RowBox[{ @@ -12842,7 +13701,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "kBalancednessQ", "]"}]}]}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -12936,8 +13795,8 @@ Cell[BoxData[ RowBox[{ "balcQ", ",", " ", "wghvec", ",", " ", "sysvec", ",", " ", "selcoal"}], "}"}], ",", " ", "balcQ"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"e5abae9c-73e8-4b24-b9cb-\ -3697c5c95a0d"], + ";"}]}]}]], "Code",ExpressionUUID->"08b20745-c0da-4994-8652-\ +89b689258d3f"], Cell[BoxData[ RowBox[{ @@ -12945,7 +13804,7 @@ Cell[BoxData[ RowBox[{"ReduceMatrix", "[", RowBox[{"wghs_List", ",", "mat_List", ",", "KC_List", ",", "onesv_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"lkc", ",", "adv", ",", "zrv", ",", "nwm"}], "}"}], ",", "\n", @@ -12983,7 +13842,7 @@ Cell[BoxData[ ",", "nwm"}], "}"}], ",", RowBox[{"{", RowBox[{"wghs", ",", "mat"}], "}"}]}], "]"}]}]}], "\n", "]"}]}], - ";"}]], "Code",ExpressionUUID->"4a0e8551-6857-4d8d-ae95-a3dfb620f62e"], + ";"}]], "Code",ExpressionUUID->"2930bd50-358b-49c8-b430-5525232c7824"], Cell[BoxData[ RowBox[{ @@ -12993,7 +13852,7 @@ Cell[BoxData[ RowBox[{ "wghs_List", ",", "mat_List", ",", "KC_List", ",", "onesv_List"}], "]"}], ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -13117,7 +13976,7 @@ Cell[BoxData[ RowBox[{"Return", "[", RowBox[{"{", RowBox[{"swgh", ",", "nwm"}], "}"}], "]"}]}]}], "\n", "]"}]}], ";"}], - "\n"}]], "Code",ExpressionUUID->"559493ca-b449-4a6b-9b77-e7de4e5937be"], + "\n"}]], "Code",ExpressionUUID->"939f0b1a-8e86-458b-ac3d-ee0a84719afc"], Cell[BoxData[ RowBox[{ @@ -13133,7 +13992,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "SelectionKBalancedQ", "]"}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -13244,8 +14103,8 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n", "\n", "\n"}]}]], "Code",ExpressionUUID->"7182ac1e-\ -24c9-4d13-aa86-e0fae926ad55"], + "]"}]}], ";"}], "\n", "\n", "\n"}]}]], "Code",ExpressionUUID->"db8829c7-\ +f247-4282-b638-c8d672361a59"], Cell[BoxData[{ RowBox[{ @@ -13256,7 +14115,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "SelectionKBalancedQ", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"verb", ",", " ", "cst"}], "}"}], ",", "\n", " ", @@ -13359,7 +14218,7 @@ Cell[BoxData[{ RowBox[{"(*", " ", RowBox[{"User", " ", "interface", " ", "for", " ", "coalition", " ", RowBox[{"structures", "."}]}], " ", "*)"}]}]}], "Code",ExpressionUUID->\ -"60a12320-b27f-42fd-b5ff-7adcbd98328c"], +"823c59b8-532a-4124-b45d-fe8e9c25458d"], Cell[BoxData[ RowBox[{ @@ -13369,7 +14228,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "SelectionKBalancedQ", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -13435,7 +14294,7 @@ Cell[BoxData[ RowBox[{ "Print", "[", "\"\\"", "]"}]}], "\n", " ", "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->\ -"70f5c5ad-dc5c-4dae-a515-890effb9631c"], +"9f7e94a9-4b90-40cd-ad9a-c783667ea36b"], Cell[BoxData[{ RowBox[{ @@ -13446,7 +14305,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "SelectionKBalancedQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -13692,7 +14551,7 @@ Cell[BoxData[{ RowBox[{"ComputeWeights", "[", RowBox[{"kmatrix_List", ",", " ", "onesv_List", ",", " ", "k_Integer"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"trkmat", ",", " ", "d1", ",", " ", "d2"}], "}"}], ",", "\n", @@ -13724,7 +14583,7 @@ Cell[BoxData[{ RowBox[{"WghsPseudoInvers", "[", RowBox[{"kmatrix_List", ",", " ", "onesv_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"psmat", ",", " ", "wghs", ",", " ", "psQ", ",", " ", "trQ"}], @@ -13755,7 +14614,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"DetPositiveWeights", "[", RowBox[{"kmatrix_List", ",", " ", "wghs_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -13766,8 +14625,7 @@ Cell[BoxData[{ RowBox[{"NullSpace", "[", RowBox[{"Transpose", "[", "kmatrix", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"nlvec", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "nlsp"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "nlsp", "]"}]}], ";", "\n", " ", RowBox[{"nwghs01", " ", "=", " ", RowBox[{"wghs", " ", "+", " ", RowBox[{ @@ -13802,14 +14660,14 @@ Cell[BoxData[{ RowBox[{"[", "2", "]"}], "]"}], ",", "True"}], "]"}], ",", " ", "nwghs02", ",", "\n", " ", "True", ",", " ", "wghs"}], "\n", " ", "]"}]}]}], "\n", "]"}]}], ";"}], "\n"}], "Code",Expressio\ -nUUID->"5b9cc908-dca1-4dc8-b91f-f4c43a203562"], +nUUID->"833964ee-3a07-44e1-ad8e-6ce92242d710"], Cell[BoxData[ RowBox[{"(*", RowBox[{ "Alternative", " ", "Function", " ", "to", " ", "check", " ", "a", " ", - "Kohlberg", " ", "criterion"}], "*)"}]], "Code",ExpressionUUID->"f9a77cc8-\ -0bfc-4e8d-b298-412924701f88"], + "Kohlberg", " ", "criterion"}], "*)"}]], "Code",ExpressionUUID->"fc0fb39b-\ +303b-4362-9c83-3d87c28d9b0f"], Cell[BoxData[{ RowBox[{ @@ -13827,7 +14685,7 @@ Cell[BoxData[{ RowBox[{"opts", " ", ":", " ", RowBox[{"OptionsPattern", "[", "BalancedCollectionQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"dimpay", ",", " ", "cc"}], "}"}], ",", " ", @@ -13883,14 +14741,14 @@ Cell[BoxData[{ RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "]"}], ",", " ", "\n", " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "]"}]}]}], "]"}]}], - ";"}]}], "Code",ExpressionUUID->"b9e58ddc-2cd9-4e4b-a92f-d2190e28457b"], + ";"}]}], "Code",ExpressionUUID->"a36fdb75-7493-43cb-a00c-e800bb3b582a"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"BalancedCollMainQ", "[", RowBox[{"game_", ",", " ", "payoff_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -13935,7 +14793,7 @@ Cell[BoxData[ RowBox[{"acde", ",", " ", "tk"}], "]"}]}]}], ";", "\n", " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "lprs"}], "]"}]}]}], "]"}]}], ";"}]], "Code",E\ -xpressionUUID->"9d5fcdb1-621e-4597-91c2-020ab1510ca3"], +xpressionUUID->"e4f50c81-b0d5-420c-9c8b-646749cd93c7"], Cell[BoxData[{ RowBox[{ @@ -13943,7 +14801,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"RankConQ", "[", RowBox[{"coll_List", ",", " ", "T_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -13984,7 +14842,7 @@ Cell[BoxData[{ RowBox[{"(*", " ", RowBox[{ RowBox[{"Nucleolus", "/", "Kernel"}], " ", "section", " ", "ends"}], " ", - "*)"}]}]}], "Code",ExpressionUUID->"35a044fc-43ca-49e2-b546-d8e43632fb03"], + "*)"}]}]}], "Code",ExpressionUUID->"08805861-dcc9-426e-98dd-bfe18b7e308f"], Cell[BoxData[ RowBox[{ @@ -14036,8 +14894,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Length", "[", RowBox[{"W", "[", "i", "]"}], "]"}], "-", "1"}], ")"}]}]}], - "]"}]}], "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"f9f7ab91-55d3-\ -45bc-a147-721c9ca3bdb8"], + "]"}]}], "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"1c1db585-2a69-\ +4466-8fa4-28393a23bd2e"], Cell[BoxData[{ RowBox[{ @@ -14063,9 +14921,8 @@ Cell[BoxData[{ RowBox[{"(", RowBox[{ RowBox[{"v", "[", "T", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", - RowBox[{"UpperVector", "[", "game", "]"}]}], "]"}]}], ")"}]}]}]}], + RowBox[{"Total", "[", + RowBox[{"UpperVector", "[", "game", "]"}], "]"}]}], ")"}]}]}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{ @@ -14112,7 +14969,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "FindPreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pay", "}"}], ",", "\n", " ", RowBox[{ @@ -14126,8 +14983,8 @@ Cell[BoxData[{ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"FindPreKernelSolution", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"013d0d54-a369-4bc9-a3f8-\ -c170ac56f486"], + "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"9d3aa22f-598a-474e-9b6d-\ +372feac3ef3c"], Cell[BoxData[{ RowBox[{ @@ -14138,7 +14995,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "FindPreKernelSolution", "]"}]}]}], "]"}], ":=", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -14295,7 +15152,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "FindKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pay", "}"}], ",", "\n", " ", RowBox[{ @@ -14309,8 +15166,8 @@ Cell[BoxData[{ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"FindKernelSolution", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"c79134b7-96a1-4dd4-b218-\ -f944120f7397"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"8bd7ce90-53b6-4e64-9f9d-\ +9b8e298fc947"], Cell[BoxData[{ RowBox[{ @@ -14321,7 +15178,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "FindKernelSolution", "]"}]}]}], "]"}], ":=", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -14483,7 +15340,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"SolutionSelection", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"bool", ",", "pos", ",", "lsg"}], "}"}], ",", "\n", @@ -14517,9 +15374,9 @@ Cell[BoxData[{ RowBox[{ "game_", ",", " ", "payoff_List", ",", " ", "prec_", ",", "rattol_", ",", "setk_", ",", "silent_", ",", - RowBox[{"payold_:", + RowBox[{"payold_", ":", RowBox[{"{", "}"}]}]}], "]"}], " ", ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"payvec", ",", " ", @@ -14891,7 +15748,7 @@ Cell[BoxData[{ " ", RowBox[{"ReplacePart", "[", RowBox[{"vec", ",", " ", "nwcom", ",", " ", "posi"}], "]"}]}], - ";"}]}], "Code",ExpressionUUID->"8d28078f-8a96-48e7-a626-828345949cf3"], + ";"}]}], "Code",ExpressionUUID->"31d67677-6d61-4f4a-b2aa-e0254570595d"], Cell[BoxData[ RowBox[{"(*", " ", @@ -14904,7 +15761,7 @@ Cell[BoxData[ RowBox[{"n", "-", "1"}], ")"}], "/", "2"}]}], ")"}], " ", "initial", " ", "LPs", " ", "for", " ", RowBox[{"KernelCalculation", "[", "]"}]}], " ", "*)"}]], "Code",ExpressionU\ -UID->"6e777bf9-b345-4acc-a5f7-c52509da701f"], +UID->"a530db33-6ca1-436f-b70f-c4e1afd23264"], Cell[BoxData[{ RowBox[{ @@ -14914,7 +15771,7 @@ Cell[BoxData[{ RowBox[{ "i_Integer", ",", " ", "j_Integer", ",", " ", "Global`\[Delta]_", ",", " ", - RowBox[{"eps_:", "0"}]}], "]"}], " ", ":=", " ", "\n", " ", + RowBox[{"eps_", ":", "0"}]}], "]"}], " ", ":=", " ", "\n", " ", RowBox[{ RowBox[{ RowBox[{ @@ -14936,7 +15793,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"TransferConstraints", "[", RowBox[{"game_", ",", " ", "i_Integer", ",", " ", "j_Integer", ",", " ", - RowBox[{"eps_:", "0"}]}], "]"}], " ", ":=", " ", "\n", " ", + RowBox[{"eps_", ":", "0"}]}], "]"}], " ", ":=", " ", "\n", " ", RowBox[{ RowBox[{"Append", "[", RowBox[{ @@ -14951,8 +15808,8 @@ Cell[BoxData[{ RowBox[{"j", ",", " ", "i", ",", " ", RowBox[{"-", "Global`\[Delta]"}], ",", " ", "eps"}], "]"}], ",", " ", "\n", " ", "delconst"}], "}"}]}], "]"}], " ", "//", - " ", "Flatten"}]}], ";"}]}], "Code",ExpressionUUID->"33550466-4fa2-4eaa-\ -90ca-02faefa63329"], + " ", "Flatten"}]}], ";"}]}], "Code",ExpressionUUID->"10f6bc2c-6fee-4779-\ +afc3-e3fe74b780e0"], Cell[BoxData[{ RowBox[{ @@ -14969,11 +15826,11 @@ Cell[BoxData[{ RowBox[{"DeltaLP", "[", RowBox[{ "game_", ",", " ", "i_Integer", ",", " ", "j_Integer", ",", " ", - RowBox[{"eps_:", "0"}], ",", " ", + RowBox[{"eps_", ":", "0"}], ",", " ", RowBox[{"ops", ":", RowBox[{"OptionsPattern", "[", "DeltaLP", "]"}]}]}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "changesolver", "}"}], ",", "\n", " ", RowBox[{ @@ -14990,9 +15847,10 @@ Cell[BoxData[{ RowBox[{"DeltaLP", "[", RowBox[{ "game_", ",", " ", "i_Integer", ",", " ", "j_Integer", ",", " ", - RowBox[{"eps_:", "0"}], ",", " ", - RowBox[{"changesolver_:", "False"}]}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"eps_", ":", "0"}], ",", " ", + RowBox[{"changesolver_", ":", "False"}]}], "]"}], " ", ":=", "\n", + " ", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -15031,7 +15889,7 @@ Cell[BoxData[{ RowBox[{"delconst", " ", "=", " ", RowBox[{"{", RowBox[{"Global`\[Delta]", " ", ">=", " ", "0"}], "}"}]}], - ";"}]}], "Code",ExpressionUUID->"9f5ef2b1-2e67-4c2e-a76b-6ebe0e355d81"], + ";"}]}], "Code",ExpressionUUID->"6755731e-c88e-48aa-984c-f149b46e666d"], Cell[BoxData[{ RowBox[{ @@ -15053,7 +15911,7 @@ Cell[BoxData[{ RowBox[{ "y_List", ",", " ", "T_List", ",", " ", "d_", ",", " ", "i_Integer", ",", " ", "j_Integer"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "idmat", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -15077,9 +15935,9 @@ Cell[BoxData[{ RowBox[{ RowBox[{"MaxDeltaij", "[", RowBox[{"game_", ",", " ", - RowBox[{"eps_:", "0"}], ",", "changesolver_"}], "]"}], " ", ":=", " ", - "\n", " ", - RowBox[{"Module", "[", + RowBox[{"eps_", ":", "0"}], ",", "changesolver_"}], "]"}], " ", ":=", + " ", "\n", " ", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15128,7 +15986,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"TijLoop", "[", "game_", "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15177,7 +16035,7 @@ Cell[BoxData[{ RowBox[{"anf", ",", " ", "1"}], "]"}]}], ";"}]}], "]"}], ";", "\n", " ", RowBox[{"Return", "[", "menge", "]"}]}]}], "]"}]}], ";"}]}], "Code",Expr\ -essionUUID->"3ca45df7-6c36-45b3-ac4c-4392dabc2963"], +essionUUID->"24890eea-7864-4289-a989-09b3318aa435"], Cell[BoxData[{ RowBox[{ @@ -15210,7 +16068,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"SortConstraints", "[", RowBox[{"ineq_", ",", " ", "para_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"pospattern", ",", " ", "rg", ",", "extpos"}], "}"}], ",", " ", @@ -15241,7 +16099,7 @@ Cell[BoxData[{ " ", "rg"}]}], "]"}]}], ";", "\n", " ", RowBox[{"Extract", "[", RowBox[{"ineq", ",", " ", "extpos"}], "]"}]}]}], "]"}]}], - ";"}]}], "Code",ExpressionUUID->"db67bf21-521a-4702-bbfe-2c6921627047"], + ";"}]}], "Code",ExpressionUUID->"10530774-9cca-4907-b9c2-3de5602bf2f9"], Cell[BoxData[ RowBox[{ @@ -15250,7 +16108,7 @@ Cell[BoxData[ RowBox[{"FeasibleConstraints", "[", RowBox[{"ineq_", ",", " ", "delta_", ",", "changesolver_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"newungl", ",", @@ -15330,8 +16188,7 @@ Cell[BoxData[ RowBox[{"x", " ", "/@", " ", "T"}], ",", " ", "redpara"}], "]"}], " ", "//", " ", "Flatten"}]}], ";", "\n", " ", RowBox[{"zf", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "redpara"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "redpara", "]"}]}], ";", "\n", " ", RowBox[{"sol", " ", "=", " ", RowBox[{"Which", "[", RowBox[{ @@ -15361,16 +16218,16 @@ Cell[BoxData[ " ", RowBox[{"{", RowBox[{"resl", ",", " ", "setofineq"}], "}"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n", "\n"}]], "Code",ExpressionUUID->"79d75033-cb8a-\ -43cd-adda-8432731095a8"], + "]"}]}], ";"}], "\n", "\n"}]], "Code",ExpressionUUID->"8b9ed0af-75b9-\ +45b1-8541-9abde0ff18ac"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"NewConstraints", "[", RowBox[{"sets_", ",", " ", "constraints_", ",", " ", "del_", ",", " ", - RowBox[{"eps_:", "0"}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"eps_", ":", "0"}]}], "]"}], " ", ":=", " ", "\n", " ", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"Tijsys", ",", " ", "delta", ",", " ", @@ -15416,21 +16273,21 @@ Cell[BoxData[ RowBox[{"mengsys", ",", " ", "1"}], "]"}]}]}]}], "]"}], ";", " ", "\n", " ", RowBox[{"Return", "[", "const", "]"}]}]}], "]"}]}], ";"}]], "Code",Expre\ -ssionUUID->"aa967f6f-5240-4f34-ac50-bfb11cffd073"], +ssionUUID->"cf4e1bff-04a5-440b-b403-cc110c125447"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ "Auxiliary", " ", "functions", " ", "to", " ", "verify", " ", "balancedness", " ", "of", " ", "the", " ", "excess", " ", "vector"}], " ", - "*)"}]], "Code",ExpressionUUID->"9e6ac50e-54f0-4901-afa9-814ba4c76b12"], + "*)"}]], "Code",ExpressionUUID->"a73ba9a3-8cd0-467c-ac51-6e0471e8c7e2"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"CheckBalancedness", "[", RowBox[{"game_", ",", " ", "pay_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", " ", "balancedQ", "}"}], ",", "\n", " ", RowBox[{"balancedQ", " ", "=", " ", @@ -15438,14 +16295,14 @@ Cell[BoxData[ RowBox[{"MaxExcessBalanced", "[", RowBox[{"newgame", ",", " ", "pay"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",Expre\ -ssionUUID->"21463ec2-8c91-4d6c-b51f-5969f6eb8336"], +ssionUUID->"e759c170-05a9-4db7-8d60-07debcd1b3ec"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"AssgPay", "[", "payoff_List", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "vars", "}"}], ",", "\n", " ", RowBox[{ @@ -15533,8 +16390,8 @@ Cell[BoxData[{ RowBox[{"{", "#", "}"}], "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", RowBox[{"{", RowBox[{"Last", "[", "plj", "]"}], "}"}]}], " ", "/.", " ", - "asspay"}]}], ";"}], " "}]}], "Code",ExpressionUUID->"a104e349-1d7d-\ -443f-a96d-f0ab28fe33c7"], + "asspay"}]}], ";"}], " "}]}], "Code",ExpressionUUID->"fd5193e3-fc3d-\ +46ec-9ae5-a8001774ae29"], Cell[BoxData[{ RowBox[{ @@ -15551,7 +16408,7 @@ Cell[BoxData[{ RowBox[{ "game_", ",", " ", "pi_", ",", " ", "pj_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "payass", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -15619,7 +16476,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";", RowBox[{"Return", "[", "]"}]}]}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"110592a5-78e9-49ad-9eb0-0bd1d23ffb80"], + ";"}]}], "Code",ExpressionUUID->"464b66d4-8587-4fc4-b457-dae7a6fdc6d9"], Cell[BoxData[ RowBox[{ @@ -15629,7 +16486,7 @@ Cell[BoxData[ RowBox[{ "game_", ",", " ", "pi_", ",", " ", "pj_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "payass", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -15697,8 +16554,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";", RowBox[{"Return", "[", "]"}]}]}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->"eadaaa23-51f3-4046-b035-\ -d1d3c8e45bf3"], + "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->"f80ac963-743e-4577-942a-\ +49884e709d96"], Cell[BoxData[{ RowBox[{ @@ -15707,7 +16564,7 @@ Cell[BoxData[{ RowBox[{"MaxSurpluses", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15758,7 +16615,7 @@ Cell[BoxData[{ RowBox[{"AntiSurpluses", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15805,8 +16662,8 @@ Cell[BoxData[{ RowBox[{"List", ",", RowBox[{"{", RowBox[{"minpi", ",", "minpj"}], "}"}]}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"be35cfda-03d5-4168-892c-\ -8a0c8a9a48a2"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"dd1f03ec-34bf-4a28-9475-\ +06d627bc3aeb"], Cell[BoxData[{ RowBox[{ @@ -15824,7 +16681,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AllMaxSurpluses", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15859,8 +16716,8 @@ Cell[BoxData[{ RowBox[{"dispmat", " ", "==", " ", "False"}], ",", " ", "ergb", ",", " ", "True", ",", " ", RowBox[{"DisplayResult", "[", "ergb", "]"}]}], "]"}]}]}], "\n", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"772b1806-4bec-4e7e-93fc-\ -a8488d1ccc35"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"3d5f4753-337e-421a-b14f-\ +db6c92f29223"], Cell[BoxData[{ RowBox[{ @@ -15879,7 +16736,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AllAntiSurpluses", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15918,7 +16775,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"DisplayResult", "[", "payoff_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -15951,7 +16808,7 @@ Cell[BoxData[{ RowBox[{"MatrixForm", "[", RowBox[{"PrependTo", "[", RowBox[{"surpl", ",", "mgij"}], "]"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"0755928f-5e37-4168-91bb-8ac9b5bf6d79"], + ";"}]}], "Code",ExpressionUUID->"52c2fa25-f475-4c01-a75e-79f7794563a4"], Cell[BoxData[ RowBox[{ @@ -15973,7 +16830,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"KernelImputationQ", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", "\n", " ", RowBox[{ @@ -16027,7 +16884,7 @@ Cell[BoxData[ RowBox[{"KernelImputQ", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -16164,7 +17021,7 @@ Cell[BoxData[ " ", RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "neq"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"6774c772-dac3-4126-baf7-e6190ddc9a2b"], + ";"}]}]}]], "Code",ExpressionUUID->"7f265886-fe75-4793-89e3-b34dd0505bc6"], Cell[BoxData[{ RowBox[{ @@ -16246,7 +17103,7 @@ payoffs.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{"KernelImputationListQ", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"kerimpQ", ",", "impQ"}], "}"}], ",", "\n", " ", @@ -16290,7 +17147,7 @@ payoffs.\>\"", "]"}]}], "\n", ")"}]}], ";"}], "\n"}], "\n", " ", "True", ",", " ", RowBox[{"DisplayMessage", "[", "payoff", "]"}]}], "\n", " ", "\n", " ", "]"}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->\ -"a4467d5f-87ca-44c7-86c1-67853755ed8a"], +"dede3bc9-2fe4-46fa-82cd-c1f05080d199"], Cell[BoxData[{ RowBox[{ @@ -16305,7 +17162,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"ImputationQ", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -16325,8 +17182,8 @@ Cell[BoxData[{ RowBox[{"game", ",", "payoff"}], "]"}], ",", "\n", " ", "True", ",", " ", RowBox[{"DisplayMessage", "[", "payoff", "]"}]}], "\n", " ", "]"}]}], - "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"ff4d4c58-86b8-4263-aa9c-\ -a6a4b78d3f00"], + "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"5ac080d9-299f-41cb-8b9b-\ +f1cff0be1606"], Cell[BoxData[{ RowBox[{ @@ -16334,7 +17191,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"CheckImputations", "[", RowBox[{"game_", ",", "payoff_List"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "impQ", "}"}], ",", "\n", " ", RowBox[{ @@ -16356,7 +17213,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"TolImputations", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"tolv", ",", "indrat", ",", "eff"}], "}"}], ",", "\n", " ", @@ -16387,7 +17244,7 @@ Cell[BoxData[{ "\n", " ", RowBox[{"Append", "[", RowBox[{"indrat", ",", "eff"}], "]"}]}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"e5b79220-d413-41d1-89c9-7a17e8afdd23"], + ";"}]}], "Code",ExpressionUUID->"a8a33f99-9671-4ea1-a5fa-48b40182d10f"], Cell[BoxData[{ RowBox[{ @@ -16433,7 +17290,7 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"PreKernelQ", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"tolv", ",", "graval", ",", "dimpay"}], "}"}], ",", " ", "\n", @@ -16473,8 +17330,7 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "-", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "-", " ", "graval"}], "]"}], "<=", "tolv"}], ")"}], " ", "&"}], " ", "/@", " ", "payoff"}], ",", RowBox[{"MaxExcessBalanced", "[", @@ -16504,9 +17360,8 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "payoff"}], "]"}], " ", "-", - " ", "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", + RowBox[{"Total", "[", "payoff", "]"}], " ", "-", " ", + "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", RowBox[{"{", RowBox[{"MaxExcessBalanced", "[", RowBox[{"game", ",", " ", "payoff"}], "]"}], "}"}]}], @@ -16528,7 +17383,7 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"AntiPreKernelQ", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"tolv", ",", "graval", ",", "dimpay"}], "}"}], ",", " ", "\n", @@ -16568,8 +17423,7 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "-", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "-", " ", "graval"}], "]"}], "<=", " ", "tolv"}], ")"}], " ", "&"}], " ", "/@", " ", "payoff"}], ",", RowBox[{"MinExcessBalanced", "[", @@ -16599,9 +17453,8 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"Abs", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "payoff"}], "]"}], " ", "-", " ", - "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", + RowBox[{"Total", "[", "payoff", "]"}], " ", "-", " ", + "graval"}], "]"}], "<=", "tolv"}], "}"}], ",", RowBox[{"{", RowBox[{"MinExcessBalanced", "[", RowBox[{"game", ",", " ", "payoff"}], "]"}], "}"}]}], "}"}]}], @@ -16611,7 +17464,7 @@ single payoff vector.\>\"", "]"}]}], "\n", "\n", ")"}]}], ";"}], "\n", "\n", " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->\ -"7ec538f7-11dc-4fb0-95d5-af488d1e346b"], +"cf5135e5-3133-42b9-9b28-321274676440"], Cell[BoxData[ RowBox[{ @@ -16642,7 +17495,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "KernelCalculation", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -16881,7 +17734,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DisplayZmQKerQ01", "[", RowBox[{"zmQ_", ",", "coreQ_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -16900,7 +17753,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DisplayZmQKerQ02", "[", RowBox[{"zmQ_", ",", "coreQ_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -16918,7 +17771,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DisplayZmQKerQ03", "[", RowBox[{"zmQ_", ",", "coreQ_"}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -16940,7 +17793,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DisplayRemark", "[", "eps_Real", "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -16964,7 +17817,7 @@ list.\>\"", "]"}], ";", "\n", " ", "Print", "[", "\"\\"", "]"}]}]}], "\n", " ", "]"}]}], ";"}], - "\n"}]}]], "Code",ExpressionUUID->"7dca1cf9-5ff5-48f9-8bb7-7c0b92decf1d"], + "\n"}]}]], "Code",ExpressionUUID->"79f00fb9-54fe-4759-a6a7-86435fe40cc1"], Cell[BoxData[{ RowBox[{ @@ -16975,7 +17828,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "KernelCalculation", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"epsi1", ",", "notzeromono", ",", "critical", ",", "kernres"}], @@ -17013,7 +17866,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "KernelCalculation", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"epsi1", ",", "notzeromono", ",", "critical", ",", "kernres"}], @@ -17044,7 +17897,7 @@ Cell[BoxData[{ RowBox[{ "SetGameToNonZeroMonotonic", " ", "->", " ", "notzeromono"}]}], "]"}]}]}]}], "\n", "\n", "\n", " ", "]"}]}], ";"}]}], "Code",Expressio\ -nUUID->"8b7ba2dd-8312-4fab-8b1f-f596d2d8ca08"], +nUUID->"de91b94d-9b5b-4e98-90f6-73390bd17de9"], Cell[BoxData[ RowBox[{ @@ -17055,7 +17908,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "KernelCalculation", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17126,7 +17979,7 @@ Cell[BoxData[ RowBox[{ "SetGameToNonZeroMonotonic", " ", "->", " ", "notzeromono"}]}], "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}], - "\n"}]], "Code",ExpressionUUID->"de9645b7-2e67-4510-9c79-1bf171dc327b"], + "\n"}]], "Code",ExpressionUUID->"a04b2361-f555-46d1-b255-0953c6a35af6"], Cell[BoxData[ RowBox[{ @@ -17142,13 +17995,13 @@ Cell[BoxData[ RowBox[{ RowBox[{"KernelPoints", "[", RowBox[{"game_", ",", " ", - RowBox[{"storepay_:", + RowBox[{"storepay_", ":", RowBox[{"{", "}"}]}], ",", " ", "callm_", ",", " ", "changeps_", ",", " ", "dispres_", ",", " ", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "KernelCalculation", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17269,8 +18122,7 @@ Cell[BoxData[ "mengsys", ",", " ", "const", ",", " ", "del", ",", " ", "epsi1"}], "]"}]}], ";", "\n", " ", RowBox[{"objfunc", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "var"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "var", "]"}]}], ";", "\n", " ", RowBox[{"const", " ", "=", " ", RowBox[{"Flatten", "[", RowBox[{"Join", "[", @@ -17443,7 +18295,7 @@ Cell[BoxData[ "notzeromono"}]}], "]"}]}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}]}]], "Code",ExpressionUUID->\ -"c618379c-925e-4add-9d77-00e09e6dbd42"], +"face353a-c5fd-4326-bd68-c18d7a85b5da"], Cell[BoxData[{ RowBox[{ @@ -17451,7 +18303,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"MessageKerPoints01", "[", "erg_", "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -17465,7 +18317,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"MessageKerPoints02", " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -17503,7 +18355,7 @@ MaxExcessBalanced.\>\"", "]"}], ";"}]}], "\n", " ", "]"}]}], ";"}], "\n", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "Kernel", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17570,7 +18422,7 @@ MaxExcessBalanced.\>\"", "]"}], ";"}]}], "\n", " ", "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"KernelSubCallFir", "[", RowBox[{"game_", ",", "dispres_", ",", "callm_"}], "]"}], ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17593,8 +18445,7 @@ MaxExcessBalanced.\>\"", "]"}], ";"}]}], "\n", " ", "]"}]}], ";"}], "\n", RowBox[{"AllConstraints", "[", "newgame", "]"}]}], ";", "\n", " ", RowBox[{"objfunc", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "dvar"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "dvar", "]"}]}], ";", "\n", " ", RowBox[{"var", "=", " ", RowBox[{"Union", "[", RowBox[{ @@ -17646,7 +18497,7 @@ MaxExcessBalanced.\>\"", "]"}], ";"}]}], "\n", " ", "]"}]}], ";"}], "\n", RowBox[{ "kersol", ",", "objfunc", ",", "nb", ",", "var", ",", "tra"}], "}"}]}], "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->\ -"4d8ab4fa-0b73-4a3e-b0ad-76a7a0d6ef9b"], +"f1bae8e6-d171-40aa-894d-21806526f333"], Cell[BoxData[{ RowBox[{ @@ -17655,7 +18506,7 @@ Cell[BoxData[{ RowBox[{"KernelSubCallSec", "[", RowBox[{"game_", ",", "dispres_", ",", "callm_"}], "]"}], ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17670,8 +18521,7 @@ Cell[BoxData[{ RowBox[{"AllConstraints", "[", "game", "]"}]}], ";", " ", "\n", " ", RowBox[{"objfunc", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "dvar"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "dvar", "]"}]}], ";", "\n", " ", RowBox[{"var", "=", " ", RowBox[{"Union", "[", RowBox[{ @@ -17729,7 +18579,7 @@ Cell[BoxData[{ RowBox[{"KernelSubCallThir", "[", RowBox[{"game_", ",", "eps_", ",", "dispres_", ",", "callm_"}], "]"}], ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17745,8 +18595,7 @@ Cell[BoxData[{ RowBox[{"nb", ",", "alldelvar", ",", "dvar"}], "}"}], " ", "=", " ", RowBox[{"AllConstraints", "[", "newgame", "]"}]}], ";", "\n", " ", RowBox[{"objfunc", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "dvar"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "dvar", "]"}]}], ";", "\n", " ", RowBox[{"var", "=", " ", RowBox[{"Union", "[", RowBox[{ @@ -17797,7 +18646,7 @@ Cell[BoxData[{ RowBox[{ "kersol", ",", "objfunc", ",", "nb", ",", "var", ",", "tra"}], "}"}]}], "]"}]}]}], "\n", "\n", "]"}]}], ";"}]}], "Code",ExpressionUU\ -ID->"ab5a077f-f9fc-4b9d-a4f8-a2580589df01"], +ID->"bfd5ad0d-ea8c-4312-b8c8-03adb89b2c42"], Cell[BoxData[ RowBox[{ @@ -17818,7 +18667,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"AllConstraints", "[", "game_", "]"}], ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -17917,7 +18766,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "KernelVertices", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -18033,8 +18882,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";", "pkl"}]}], "]"}], ",", "kl"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"5e4f66b4-fcbe-4342-8648-\ -1934d9d84fe4"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"8dc76b1d-fea2-4327-873d-\ +25d5a8bb30a3"], Cell[BoxData[ RowBox[{ @@ -18043,9 +18892,9 @@ Cell[BoxData[ RowBox[{ "sol_", ",", " ", "obj_", ",", " ", "const_", " ", ",", " ", "var_", " ", ",", " ", "T_", ",", " ", "callm_", ",", "sil_", ",", " ", - RowBox[{"zf_:", + RowBox[{"zf_", ":", RowBox[{"{", "}"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -18055,8 +18904,7 @@ Cell[BoxData[ RowBox[{"oldres", "=", "sol"}]}], "}"}], ",", "\n", " ", RowBox[{ RowBox[{"nwzf", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "var"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "var", "]"}]}], ";", "\n", " ", RowBox[{"dures", " ", "=", " ", RowBox[{"SolveDual", "[", RowBox[{"nwzf", ",", " ", "const", ",", " ", "var"}], "]"}]}], ";", @@ -18160,15 +19008,15 @@ Cell[BoxData[ "oldres", ",", " ", "obj", ",", " ", "newineq", ",", " ", "var", ",", " ", "T", ",", " ", "callm", ",", " ", "sil", ",", " ", "valzf"}], "]"}]}], "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->\ -"a70fcef0-a08b-46fe-bd8f-f1a43de97a5e"], +"55aa10fd-83ca-421d-8337-33eae7a85469"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ "Section", " ", "ends", " ", "to", " ", "determine", " ", "a", " ", "Kernel", " ", "Range", " ", "from", " ", "an", " ", - RowBox[{"LP", "."}]}], " ", "*)"}]], "Code",ExpressionUUID->"5033b483-8dc6-\ -4b5f-9810-a3bdc45ca17d"], + RowBox[{"LP", "."}]}], " ", "*)"}]], "Code",ExpressionUUID->"55bf4c0d-b0d0-\ +4e23-9ffb-a4aae48c649b"], Cell[BoxData[ RowBox[{ @@ -18219,7 +19067,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AntiPreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pay", "}"}], ",", "\n", " ", RowBox[{ @@ -18233,8 +19081,8 @@ Cell[BoxData[ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"AntiPreKernelSolution", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"9ff63850-476a-46e0-9065-\ -6df8f104c177"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"207328ea-1065-49c6-a79e-\ +6d645faf66ed"], Cell[BoxData[{ RowBox[{ @@ -18245,7 +19093,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AntiPreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -18325,7 +19173,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pay", "}"}], ",", "\n", " ", RowBox[{ @@ -18339,8 +19187,8 @@ Cell[BoxData[{ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"PreKernelSolution", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"ee73ba64-6a19-448a-871e-\ -2120e1a6dec4"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"df374445-3d01-4ba8-a77c-\ +2415e39d4ff7"], Cell[BoxData[{ RowBox[{ @@ -18351,7 +19199,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -18631,7 +19479,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"WrongCoordDimension", "[", "T_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -18649,7 +19497,7 @@ length!\>\"", "]"}], ";", "\n", " ", RowBox[{ RowBox[{"WrongCoordDimension", "[", RowBox[{"coord_List", ",", "T_"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -18662,8 +19510,8 @@ length!\>\"", "]"}], ";", "\n", " ", RowBox[{"\"\\"", ",", " ", RowBox[{"2", "^", RowBox[{"Length", "[", "T", "]"}]}]}], "]"}], ";"}]}], "\n", "]"}]}], - ";"}], "\n"}], "Code",ExpressionUUID->"35944278-9676-49da-8644-\ -ed13e52c3f3f"], + ";"}], "\n"}], "Code",ExpressionUUID->"6baa7855-5f0a-4983-94cd-\ +63fe5a276c94"], Cell[BoxData[{ RowBox[{ @@ -18674,7 +19522,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelSolution", "]"}]}]}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sil", ",", "cr", ",", "gradv", ",", "cflist"}], "}"}], ",", @@ -18721,7 +19569,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -18804,8 +19652,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"{", - RowBox[{"1", ",", " ", - RowBox[{"-", "1"}]}], "}"}], ".", "#"}], " ", "&"}], " ", "/@", + RowBox[{"1.", ",", " ", + RowBox[{"-", "1."}]}], "}"}], ".", "#"}], " ", "&"}], " ", "/@", " ", "vmeff"}]}], ";", "\n", " ", RowBox[{"alpv", " ", "=", " ", RowBox[{"Prepend", "[", @@ -18820,7 +19668,7 @@ Cell[BoxData[{ RowBox[{"MapThread", "[", RowBox[{"List", ",", " ", RowBox[{"{", - RowBox[{"var", ",", " ", "payoff"}], "}"}]}], "]"}]}], ";", "\n", + RowBox[{"var", ",", "payoff"}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"minval", " ", "=", " ", RowBox[{"Which", "[", @@ -18891,21 +19739,20 @@ Cell[BoxData[{ RowBox[{"game", ",", "nwpay"}], "]"}]}], "]"}]}], ";", "\n", " ", RowBox[{"sumexc", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"Flatten", "[", + RowBox[{"Total", "[", + RowBox[{"Flatten", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"MapThread", "[", + RowBox[{"MapThread", "[", + RowBox[{ RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"Subtract", "[", - RowBox[{"#2", ",", " ", "#1"}], "]"}], "^", "2"}], " ", - "&"}], ",", " ", - RowBox[{"Outer", "[", - RowBox[{"List", ",", " ", "#"}], "]"}]}], "]"}], " ", "&"}], - " ", "/@", " ", "maxexc"}], "]"}]}], "]"}]}], ";", "\n", " ", + RowBox[{"Subtract", "[", + RowBox[{"#2", ",", " ", "#1"}], "]"}], "^", "2"}], " ", + "&"}], ",", " ", + RowBox[{"Outer", "[", + RowBox[{"List", ",", " ", "#"}], "]"}]}], "]"}], " ", "&"}], + " ", "/@", " ", "maxexc"}], "]"}], "]"}]}], ";", "\n", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"SameQ", "[", @@ -18947,7 +19794,7 @@ Cell[BoxData[{ RowBox[{ "zfc_", ",", "minw_", ",", "nwaz_", ",", " ", "fucval_", ",", " ", "mexc_", ",", " ", "addexc_"}], "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -18981,8 +19828,8 @@ Cell[BoxData[{ ",", RowBox[{"N", "[", RowBox[{"addexc", " ", "-", " ", "fucval"}], "]"}]}], "]"}], ";"}]}], - "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"d947803d-4e23-4186-\ -90b4-356aa6c208b5"], + "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"42c38b22-f040-43b2-\ +8a50-6831558234b8"], Cell[BoxData[ RowBox[{ @@ -18999,7 +19846,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelSolution", "]"}]}]}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -19092,7 +19939,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"MessageSolveLinEQ", "[", RowBox[{"cfmat_", ",", "bvec_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "alpscal", "}"}], ",", "\n", " ", RowBox[{ @@ -19117,7 +19964,7 @@ Cell[BoxData[ RowBox[{ "\"\\"", ",", " ", "alpscal"}], "]"}], ";"}]}], "\n", " ", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"d77a5cf4-db78-40e8-8431-b834179d3c16"], + ";"}]}]}]], "Code",ExpressionUUID->"8497c984-ce0a-4cca-9ed2-52e813ba379d"], Cell[BoxData[ RowBox[{ @@ -19134,7 +19981,7 @@ Cell[BoxData[ RowBox[{ "dfconjugate_List", ",", " ", "objf_", ",", " ", "xvar_List", ",", " ", "pvar_List"}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -19175,8 +20022,7 @@ Cell[BoxData[ RowBox[{"(", RowBox[{"-", "bgvec"}], ")"}]}]}], ";", "\n", " ", RowBox[{"sparts", "=", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "partsol"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "partsol", "]"}]}], ";", "\n", " ", RowBox[{"cgmat", "=", RowBox[{ RowBox[{ @@ -19220,7 +20066,7 @@ Cell[BoxData[ RowBox[{"CheckGenRes", "[", RowBox[{"vecli_List", ",", "pvec_List", ",", RowBox[{"psum_", "?", "NumberQ"}]}], "]"}], ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -19234,11 +20080,9 @@ Cell[BoxData[ RowBox[{"Length", "[", "vecli", "]"}], ">", "1"}], ",", " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "#"}], "]"}], " ", "&"}], "/@", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], "/@", " ", "vecli"}], ",", "\n", " ", "True", ",", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "vecli"}], "]"}]}], "]"}]}], ";", "\n", + RowBox[{"Total", "[", "vecli", "]"}]}], "]"}]}], ";", "\n", " ", RowBox[{"cksum", " ", "=", " ", RowBox[{"Which", "[", @@ -19265,8 +20109,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Length", "[", "extps", "]"}], "===", "0"}], ",", "pvec", ",", "extps"}], "]"}]}], ";", "\n", " ", "res"}]}], "\n", - "]"}]}], ";"}], "\n", "\n"}]}]], "Code",ExpressionUUID->"4c1481a2-cf08-\ -46e4-acbf-4b4f2047658f"], + "]"}]}], ";"}], "\n", "\n"}]}]], "Code",ExpressionUUID->"84560a71-c5d4-\ +4aa8-a165-a5ff2d8f9389"], Cell[BoxData[ RowBox[{ @@ -19285,7 +20129,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelSolution", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -19354,19 +20198,17 @@ Cell[BoxData[ ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", " ", "crlist"}]}], ";", "\n", " ", RowBox[{"obj", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "eqs"}], "]"}]}], ";", "\n", + RowBox[{"Total", "[", "eqs", "]"}]}], ";", "\n", RowBox[{"(*", " ", "efficiency", " ", "*)"}], "\n", " ", RowBox[{"eff", " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "T"}]}], "]"}], " ", "-", " ", + RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "T"}], "]"}], " ", "-", " ", RowBox[{"v", "[", "T", "]"}]}], ")"}], "^", "2"}]}], ";", "\n", RowBox[{"(*", " ", RowBox[{"Meinhardt", " ", @@ -19383,7 +20225,7 @@ Cell[BoxData[ " ", "effective", " ", "coalitions", " ", "to", " ", "balance", " ", "the", " ", "maximum", " ", RowBox[{"surpluses", "."}]}], "\n", "*)"}]}]}]], "Code",ExpressionUUID->\ -"c12640d9-37bd-4fa8-ad1f-0f2a201b194c"], +"74244cf1-6b2d-4abb-a45e-263acec790f8"], Cell[BoxData[{ RowBox[{ @@ -19391,7 +20233,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"PrintMostEff", "[", RowBox[{"payoff_List", ",", " ", "meffc_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -19636,8 +20478,8 @@ Cell[BoxData[{ ",", RowBox[{"{", RowBox[{"sigcoal", ",", "amax"}], "}"}]}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"d111bbbc-2245-4fea-a541-\ -f42f0e2ff2da"], + "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"4fdd1f54-67e0-4e6c-bc61-\ +d1708ee5d27d"], Cell[BoxData[ RowBox[{ @@ -19720,7 +20562,7 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"First", "[", "extcoal", "]"}]}], "]"}]}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}], "\n", "\n"}]], "Code",Express\ -ionUUID->"b6ebf173-6f86-49ca-8692-d5b5927b8e49"], +ionUUID->"54bbf074-e65c-4de8-944f-8f5da2c8761a"], Cell[BoxData[ RowBox[{ @@ -19755,7 +20597,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BestCoalToMatrix", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -19807,8 +20649,8 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"d20f5909-56f1-4438-8e78-\ -17c72005f685"], + "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"da51dbce-4bbb-4ece-ab29-\ +1fb07e2c64f2"], Cell[BoxData[{ RowBox[{ @@ -19819,7 +20661,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BestCoalToMatrix", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "meff", "}"}], ",", "\n", " ", RowBox[{ @@ -19846,7 +20688,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BestCoalToMatrix", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -19973,7 +20815,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ImputationToVec", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -20024,8 +20866,8 @@ Cell[BoxData[{ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"53d9770e-4855-467d-aae1-\ -d17615c7949d"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"c67c9e7a-c607-411e-9f65-\ +8864a0e5b0c8"], Cell[BoxData[{ RowBox[{ @@ -20036,7 +20878,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ImputationToVec", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -20102,7 +20944,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "SetsToVec", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -20192,7 +21034,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ImputationToEqClass", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -20243,8 +21085,8 @@ Cell[BoxData[{ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"5f570a50-deea-41ec-9173-\ -8c79df484215"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"594185b0-1509-4202-834f-\ +ca20ed6bd1e8"], Cell[BoxData[{ RowBox[{ @@ -20255,7 +21097,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ImputationToEqClass", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"unmatQ", ",", " ", "unm"}], "}"}], ",", "\n", " ", @@ -20291,7 +21133,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"DetEqClass", "[", RowBox[{"mat_List", ",", "T_"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -20316,7 +21158,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"WrongMatDimension", "[", "T_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{ @@ -20340,7 +21182,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"FuncDetEqClass", "[", RowBox[{"mat_List", ",", " ", "T_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"gb", ",", " ", "clmat"}], "}"}], ",", "\n", " ", @@ -20361,7 +21203,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"FindEqClass", "[", RowBox[{"dir_List", ",", " ", "T_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"pwmg", ",", " ", "lhs", ",", " ", "rhs"}], "}"}], ",", "\n", @@ -20401,7 +21243,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "BargainUnanMatrix", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"effvec", ",", "meff", ",", "detunan", ",", "onesv"}], "}"}], @@ -20432,15 +21274,15 @@ Cell[BoxData[{ RowBox[{"effvec", "==", "True"}], ",", " ", RowBox[{"Prepend", "[", RowBox[{"detunan", ",", "onesv"}], "]"}], ",", " ", "detunan"}], - "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"55554249-\ -2a94-4514-acc0-132efb7eb66a"], + "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"d0f2963c-\ +c2a6-4461-9ff9-9f6b3fefdcef"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"DetUnanMat", "[", RowBox[{"bsccoal_List", ",", " ", "T_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "powers", "}"}], ",", "\n", " ", RowBox[{ @@ -20454,7 +21296,7 @@ Cell[BoxData[ RowBox[{"DetDircSetIJ", "[", RowBox[{"#", ",", " ", "powers"}], "]"}], " ", "&"}], " ", "/@", " ", "bsccoal"}]}]}], "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUUID->\ -"20f9e0c3-7c2d-40b5-aac0-fba46b152ec5"], +"9f5fc2c5-f6ed-48fc-9cb2-6d95501e2c4c"], Cell[BoxData[{ RowBox[{ @@ -20462,7 +21304,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"DetDircSetIJ", "[", RowBox[{"bsccoal_List", ",", " ", "coal_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"lvec", ",", " ", "rvec"}], "}"}], ",", "\n", " ", @@ -20514,7 +21356,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"ValueExcess", "[", "excli_List", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "subexc", "}"}], ",", "\n", " ", RowBox[{ @@ -20532,15 +21374,14 @@ Cell[BoxData[{ " ", "/@", " ", RowBox[{"excli", "[", RowBox[{"[", "1", "]"}], "]"}]}], "]"}]}], ";", "\n", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"subexc", "^", "2"}]}], "]"}]}]}], " ", "\n", " ", - "]"}]}], ";"}], "\n"}], "\n", + RowBox[{"Total", "[", + RowBox[{"subexc", "^", "2"}], "]"}]}]}], " ", "\n", " ", "]"}]}], + ";"}], "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{"ValueExcess", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "dimpay", "}"}], ",", " ", "\n", " ", RowBox[{ @@ -20589,8 +21430,8 @@ Cell[BoxData[{ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"fb4955fd-4e23-453c-a3a3-\ -898ee0b392be"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"8a63378d-3c8c-4a5e-9f21-\ +273cb298668d"], Cell[BoxData[{ RowBox[{ @@ -20598,7 +21439,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"ValueExcessList", "[", RowBox[{"game_", ",", " ", "payoff_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"subexc", ",", " ", "excli"}], "}"}], ",", "\n", " ", @@ -20618,10 +21459,9 @@ Cell[BoxData[{ RowBox[{"Outer", "[", RowBox[{"List", ",", " ", "#"}], "]"}]}], "]"}], " ", "&"}], " ", "/@", " ", "excli"}], "]"}]}], ";", "\n", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"subexc", "^", "2"}]}], "]"}]}]}], " ", "\n", " ", - "]"}]}], ";"}], "\n", "\n", + RowBox[{"Total", "[", + RowBox[{"subexc", "^", "2"}], "]"}]}]}], " ", "\n", " ", "]"}]}], + ";"}], "\n", "\n", RowBox[{"(*", " ", RowBox[{ "User", " ", "interface", " ", "to", " ", "compute", " ", "an", " ", @@ -20643,7 +21483,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "OptStepSize", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"sil", ",", "smc", ",", "dimpay"}], "}"}], ",", "\n", @@ -20756,8 +21596,8 @@ Cell[BoxData[{ RowBox[{"Length", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"PreKernel", "[", RowBox[{"game", ",", "pay", ",", "opts"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"ab40719e-ff5b-4cd4-87e9-\ -87684b69d5c8"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"5cc2059a-7f98-42f9-a2a9-\ +b797f96bc8d8"], Cell[BoxData[ RowBox[{ @@ -20835,8 +21675,8 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"PrintRemark", "[", "payoff", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", - "]"}]}], ";"}]], "Code",ExpressionUUID->"c80742f7-93fa-446e-9e60-\ -f7faddd8f349"], + "]"}]}], ";"}]], "Code",ExpressionUUID->"58884a74-7d17-4a38-a271-\ +55a5c6d7d44b"], Cell[BoxData[ RowBox[{ @@ -20914,8 +21754,8 @@ Cell[BoxData[ ";", "\n", " ", RowBox[{"PreKernelAlg2", "[", RowBox[{"game", ",", "xvec", ",", "opts"}], "]"}]}]}], "]"}]}]}], - " ", "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUUID->"3d52fd28-02d3-\ -4625-890e-456f26c16685"], + " ", "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUUID->"a1d98b8c-773b-\ +475a-8032-c695f82cd278"], Cell[BoxData[ RowBox[{ @@ -20947,7 +21787,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelElement", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pay", "}"}], ",", "\n", " ", RowBox[{ @@ -20969,7 +21809,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelElement", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"dimpay", ",", "rclim"}], "}"}], ",", " ", "\n", " ", @@ -21048,7 +21888,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "PreKernelElement", "]"}]}]}], "]"}], " ", ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -21138,7 +21978,7 @@ Cell[BoxData[ RowBox[{"Silent", " ", "->", " ", "sil"}], ",", " ", RowBox[{"SmallestCardinality", " ", "->", " ", "smc"}]}], "]"}]}], "]"}]}]}], " ", "\n", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->\ -"6de11e37-dddc-4bf3-9688-c8bb2d186806"], +"69ff03b1-8790-4c96-b0cb-4288aedf3b35"], Cell[BoxData[{ RowBox[{ @@ -21157,7 +21997,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "DirectionOfImprovement", "]"}]}]}], "]"}], " ", ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -21189,19 +22029,20 @@ Cell[BoxData[{ RowBox[{"SmallestCardinality", " ", "->", " ", "smc"}]}], "]"}]}], ";", "\n", " ", RowBox[{"matE", " ", "=", " ", - RowBox[{"-", - RowBox[{"SetsToVec", "[", - RowBox[{"meff", ",", " ", "T", ",", " ", - RowBox[{"EffVector", " ", "->", " ", "True"}]}], "]"}]}]}], ";", - "\n", " ", + RowBox[{ + RowBox[{"-", + RowBox[{"SetsToVec", "[", + RowBox[{"meff", ",", " ", "T", ",", " ", + RowBox[{"EffVector", " ", "->", " ", "True"}]}], "]"}]}], " ", "//", + " ", "N"}]}], ";", "\n", " ", RowBox[{"submex", " ", "=", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"{", - RowBox[{"1", ",", " ", - RowBox[{"-", "1"}]}], "}"}], ".", "#"}], " ", "&"}], " ", "/@", - " ", "mex"}]}], ";", " ", "\n", " ", + RowBox[{"1.", ",", " ", + RowBox[{"-", "1."}]}], "}"}], ".", "#"}], " ", "&"}], " ", "/@", + " ", "mex"}]}], ";", "\n", " ", RowBox[{"varpay", " ", "=", " ", RowBox[{ RowBox[{ @@ -21217,13 +22058,11 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "T", "]"}], " ", "-", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", + RowBox[{"Total", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", - "T"}]}], "]"}]}], " ", "/.", " ", "setpay"}]}], ";", "\n", " ", - + RowBox[{"x", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "T"}], + "]"}]}], " ", "/.", " ", "setpay"}]}], ";", "\n", " ", RowBox[{"PrependTo", "[", RowBox[{"submex", ",", " ", "grmex"}], "]"}], ";", "\n", " ", RowBox[{"If", "[", @@ -21274,7 +22113,7 @@ Cell[BoxData[{ RowBox[{"DelStar", "[", RowBox[{"doi_List", ",", " ", "matE_List", ",", " ", "smex_List"}], "]"}], ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"edvec", ",", "nrsq", ",", "tol"}], "}"}], ",", "\n", " ", @@ -21298,8 +22137,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{"-", " ", RowBox[{"smex", ".", "edvec"}]}], "/", "nrsq"}]}], "]"}]}]}], "\n", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"9604ef8e-ab86-4339-a031-\ -50715dc08dca"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"a618e868-3783-45e6-ae84-\ +d1787028c75d"], Cell[BoxData[ RowBox[{ @@ -21342,7 +22181,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "ConvexConjugate", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -21390,15 +22229,14 @@ Cell[BoxData[ RowBox[{"Length", "[", "T", "]"}]}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"inprod", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"MapThread", "[", + RowBox[{"Total", "[", + RowBox[{"MapThread", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"Times", "[", - RowBox[{"#1", ",", " ", "#2"}], "]"}], " ", "&"}], ",", " ", - RowBox[{"{", - RowBox[{"norvar", ",", " ", "var"}], "}"}]}], "]"}]}], "]"}]}], + RowBox[{"Times", "[", + RowBox[{"#1", ",", " ", "#2"}], "]"}], " ", "&"}], ",", " ", + RowBox[{"{", + RowBox[{"norvar", ",", " ", "var"}], "}"}]}], "]"}], "]"}]}], ";", "\n", " ", RowBox[{"funchst", " ", "=", " ", RowBox[{ @@ -21524,7 +22362,7 @@ of h has no solution.\>\"", "]"}]}], ";"}], "\n", "\n", RowBox[{ RowBox[{"SolSys", "[", RowBox[{"eqsys_List", ",", "var_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "redsol", "}"}], ",", "\n", " ", RowBox[{ @@ -21551,7 +22389,7 @@ of h has no solution.\>\"", "]"}]}], ";"}], "\n", "\n", "\"\\"", ",", " ", RowBox[{"Length", "[", "hstfunc", "]"}]}], "]"}]}], ")"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"c30214e8-f246-4477-a1c8-75500a4a466b"], + ";"}]}]}]], "Code",ExpressionUUID->"b3c3ba4a-b100-40e9-a5b5-21556ad59fb1"], Cell[BoxData[ RowBox[{ @@ -21579,8 +22417,8 @@ objective function h,\>\"", "]"}], ";", "\n", " ", solution is not a unique vector!\>\"", "]"}], ";", "\n", " ", RowBox[{ "Print", "[", "\"\\"", - "]"}]}], "\n", ")"}]}], ";"}]], "Code",ExpressionUUID->"d0c315be-0538-\ -4824-b886-e29eb398f246"], + "]"}]}], "\n", ")"}]}], ";"}]], "Code",ExpressionUUID->"85732a78-c71f-\ +4f13-bc39-8cb21bec3391"], Cell[BoxData[{ RowBox[{ @@ -21673,7 +22511,7 @@ vector.\>\"", "]"}], ";", "\n", " ", RowBox[{ RowBox[{"(*", " ", RowBox[{"Kernel", " ", "section", " ", "ends"}], " ", "*)"}]}]}], "Code",Ex\ -pressionUUID->"7b3dc8b0-b8b1-47ea-959a-d9d9a2d4ee2a"], +pressionUUID->"0f881549-cf89-4cf1-9bf9-254354ca6ffe"], Cell[BoxData[ RowBox[{ @@ -21755,7 +22593,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddVerticesCore", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -21866,7 +22704,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddVerticesReasonableSet", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -21982,7 +22820,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddVerticesReasonableSet", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22106,7 +22944,7 @@ Cell[BoxData[ RowBox[{"Drop", "[", RowBox[{"#", ",", " ", "1"}], "]"}], " ", "&"}], " ", "/@", " ", "sortlist"}]}]}], "\n", " ", "]"}]}], ";"}], "\n"}]}]], "Code",Expr\ -essionUUID->"94ce0b82-30d0-4158-af3d-7994f39a82b3"], +essionUUID->"6c0878e5-ed6a-4a43-9912-f7cb21c5128f"], Cell[BoxData[{ RowBox[{ @@ -22124,7 +22962,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddVerticesLowerSet", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22237,7 +23075,7 @@ Cell[BoxData[{ RowBox[{"Drop", "[", RowBox[{"#", ",", " ", "1"}], "]"}], " ", "&"}], " ", "/@", " ", "sortlist"}]}]}], "\n", " ", "]"}]}], ";"}], "\n"}], "Code",Expressio\ -nUUID->"0b8c1330-9b47-4e20-a875-ce99923af091"], +nUUID->"18ae62cd-0674-459b-9bc4-587e16868932"], Cell[BoxData[{ RowBox[{ @@ -22255,7 +23093,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddGmpVerticesCore", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22402,7 +23240,7 @@ Cell[BoxData[{ RowBox[{"vertlist1", ",", "incidences1"}], "}"}], ",", "\n", " ", "True", ",", " ", "vertlist1"}], "\n", " ", "]"}]}]}], "\n", "]"}]}], ";"}]}], "Code",ExpressionU\ -UID->"4ba7358c-685a-4e9f-ba4f-66d4c3ee15a9"], +UID->"ea8c0b19-5e97-4d05-8986-8b84e2acb7e8"], Cell[BoxData[{ RowBox[{ @@ -22421,7 +23259,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddGmpPlotCore", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22518,7 +23356,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"CddGmpPlotImputationSet", "[", "game_", "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22620,7 +23458,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"CddGmpImputationVertices", "[", "game_", "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22716,7 +23554,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddGmpPlotReasonableSet", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22834,7 +23672,7 @@ Cell[BoxData[{ RowBox[{"vertlist1", ",", "linearity1"}], "}"}], ",", "ecdlist1", ",", "eadlist1", ",", "icdlist1", ",", "iadlist1", ",", "extmat"}], "}"}]}]}], "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->\ -"3df4453e-873d-4829-a34c-3033e88475dc"], +"6dbb3bce-25b5-4633-aefd-1abf149fbe2e"], Cell[BoxData[{ RowBox[{ @@ -22853,7 +23691,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "CddGmpPlotLowerSet", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -22981,17 +23819,16 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"BaryCenter", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "crv", "}"}], ",", "\n", " ", RowBox[{ RowBox[{"crv", "=", RowBox[{"CddGmpVerticesCore", "[", "game", "]"}]}], ";", "\n", " ", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "crv"}], "]"}], "/", + RowBox[{"Total", "[", "crv", "]"}], "/", RowBox[{"Length", "[", "crv", "]"}]}]}]}], "\n", "\t\t ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"80e4c9f9-14cf-412c-b37f-6004eb5ecd90"], + ";"}]}], "Code",ExpressionUUID->"fe4e51c5-478c-4367-8b38-69de68e99c7f"], Cell[BoxData[ RowBox[{ @@ -23001,7 +23838,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "AnimationKernelProperty2d", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -23063,7 +23900,7 @@ Cell[BoxData[ RowBox[{"stpsize", "[", RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}]], "Code",ExpressionUU\ -ID->"3c8fd2a7-69b6-40f9-b749-06ce16b5ad0e"], +ID->"c2fa5b0f-c9a8-48ad-801a-04de17f9d1dc"], Cell[BoxData[{ RowBox[{ @@ -23082,7 +23919,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "StrongEpsCore2d", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -23217,7 +24054,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "FilledCoreV6", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -23547,7 +24384,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"PointSol", "[", "game_", "]"}], " ", ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"kr", ",", "nc", ",", "shv", ",", "prk"}], "}"}], ",", "\n", @@ -23572,8 +24409,8 @@ Cell[BoxData[{ RowBox[{"Vec3DToSimplex", "[", "#", "]"}], " ", "&"}], "/@", " ", RowBox[{"{", RowBox[{"kr", ",", "nc", ",", "shv", ",", "prk"}], "}"}]}]}]}], "\n", - "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"1e6c77e7-8369-4b19-8fc7-\ -cee551dadefe"], + "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"bd2ebffc-8df7-4bd5-8202-\ +378fa08ad563"], Cell[BoxData[ RowBox[{"(*", " ", @@ -23582,7 +24419,7 @@ Cell[BoxData[ RowBox[{"deprecated", ".", " ", "Use"}], " ", "TuGames", " ", "Version", " ", "1.8", " ", "if", " ", "you", " ", "need", " ", "this", " ", RowBox[{"function", "."}]}], " ", "*)"}]], "Code",ExpressionUUID->\ -"570f2c4d-4a52-416e-8a4f-f54a150d6745"], +"0c965ad6-eb1e-414b-bd9a-bd7b8ac1a280"], Cell[BoxData[{ RowBox[{ @@ -23595,7 +24432,7 @@ Cell[BoxData[{ RowBox[{"x2_", "?", "NumberQ"}], ",", " ", RowBox[{"x3_", "?", "NumberQ"}]}], "}"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", " ", RowBox[{"{", @@ -23634,7 +24471,7 @@ Cell[BoxData[{ RowBox[{"x3_", "?", "NumberQ"}], ",", " ", RowBox[{"x4_", "?", "NumberQ"}]}], "}"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", " ", RowBox[{"{", @@ -23657,7 +24494,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"(*", " ", RowBox[{"End", " ", "mathlink", " ", "section"}], " ", "*)"}]}]}], "Code",E\ -xpressionUUID->"7492aa97-0daf-4ab2-a930-bc8493468f87"], +xpressionUUID->"b0e2dde6-1b0b-4213-8fea-ee4335432e29"], Cell[BoxData[ RowBox[{ @@ -23678,7 +24515,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"AdjustedWorthVectors", "[", RowBox[{"game_", ",", " ", "k_Integer"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "permliste", "}"}], ",", "\n", " ", RowBox[{"If", "[", @@ -23780,7 +24617,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"PDeltaI", "[", RowBox[{"list_", ",", " ", "player_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"thresh", ",", " ", "newlist", ",", " ", @@ -23824,7 +24661,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"PlayerIJoin", "[", RowBox[{"list_", ",", " ", "player_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pl", "}"}], ",", "\n", " ", RowBox[{ @@ -23850,7 +24687,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DeltaJSet", "[", RowBox[{"list_", ",", " ", "k_Integer"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -23886,20 +24723,20 @@ Cell[BoxData[ RowBox[{ RowBox[{"Union", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "retval"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}], - "\n"}]}]], "Code",ExpressionUUID->"bc604488-0a62-440f-9927-55608d920c5e"], + "\n"}]}]], "Code",ExpressionUUID->"c3f523b5-846b-4478-a560-de65201e2b46"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ "section", " ", "adjusted", " ", "worth", " ", "vector", " ", "ends"}], " ", - "*)"}]], "Code",ExpressionUUID->"7b63e066-7de8-46ac-9ee6-be47ab202172"], + "*)"}]], "Code",ExpressionUUID->"c704d20f-39e2-402d-8b43-47992fa58862"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ RowBox[{"section", " ", "general", " ", "k"}], "-", RowBox[{"convex", " ", "functions", " ", "starts"}]}], " ", "*)"}]], "Code",\ -ExpressionUUID->"73d6b4c5-bbf4-4d5d-9cfd-aaba647376e2"], +ExpressionUUID->"c7c0a15d-e552-4f1d-b5e6-3bf7c9bd575d"], Cell[BoxData[{ RowBox[{ @@ -23921,7 +24758,7 @@ Cell[BoxData[{ RowBox[{"Gap", "[", "game", "]"}], ",", RowBox[{"-", "1"}]}], "]"}], " ", "/", " ", RowBox[{"Length", "[", "T", "]"}]}]}]}], ";"}]}], "Code",ExpressionUUID->\ -"9fcb4b66-906d-4e80-9560-bc10728eb67a"], +"95c1416b-9e39-4252-9fa6-5a1f09e9eeac"], Cell[BoxData[{ RowBox[{ @@ -24058,39 +24895,182 @@ Cell[BoxData[{ RowBox[{"(", RowBox[{ RowBox[{"Message", "[", - RowBox[{"UpperSum", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], + RowBox[{"UpperSum", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], + ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"UpperSum", "[", + RowBox[{"game_", ",", " ", "S_List"}], "]"}], ":=", " ", + RowBox[{"Plus", " ", "@@", " ", + RowBox[{"UpperPayoff", " ", "/@", " ", "S"}]}]}], ";"}]}], "Code",Expressi\ +onUUID->"b414ca33-ef05-47c8-bc95-3d9efbed2450"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{ + RowBox[{"Gap", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"Gap", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], + ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Gap", "[", "game_", "]"}], ":=", " ", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"UpperSum", "[", + RowBox[{"game", ",", "#"}], "]"}], " ", "-", " ", + RowBox[{"v", "[", "#", "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", + "Coalitions"}]}], ";"}], "\n", "\n", + RowBox[{"(*", " ", + RowBox[{"Generalized", " ", "Gap", " ", "Function"}], " ", "*)"}], + "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenConcession", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"GenConcession", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenConcession", "[", "game_", "]"}], ":=", " ", + RowBox[{"Map", "[", + RowBox[{"Min", ",", + RowBox[{"Table", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"GenUpperSum", "[", + RowBox[{"game", ",", "#"}], "]"}], " ", "-", " ", + RowBox[{"v", "[", "#", "]"}]}], ")"}], " ", "&"}], " ", "/@", + " ", + RowBox[{"W", "[", "i", "]"}]}], ",", + RowBox[{"{", + RowBox[{"i", ",", + RowBox[{"Length", "[", "T", "]"}]}], "}"}]}], "]"}]}], "]"}]}], + ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenUtopiaPayoff", "[", + RowBox[{"game_", ",", " ", "i_"}], "]"}], " ", ":=", "\n", " ", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "-", " ", + RowBox[{"v", "[", + RowBox[{"DeleteCases", "[", + RowBox[{"T", ",", " ", "i"}], "]"}], "]"}]}], " ", "/;", "\n", + " ", + RowBox[{ + RowBox[{ + RowBox[{"Last", "[", + RowBox[{"GenGap", "[", "game", "]"}], "]"}], " ", ">", " ", "0"}], + " ", "&&", " ", + RowBox[{ + RowBox[{ + RowBox[{"GenGap", "[", "game", "]"}], "[", + RowBox[{"[", + RowBox[{"i", " ", "+", " ", "1"}], "]"}], "]"}], " ", ">=", " ", + "0"}]}]}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenUpperPayoff", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"GenUpperPayoff", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenUpperPayoff", "[", "i_", "]"}], ":=", " ", + RowBox[{"Max", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "-", " ", + RowBox[{"v", "[", + RowBox[{"DeleteCases", "[", + RowBox[{"#", ",", "i"}], "]"}], "]"}]}], ")"}], " ", "&"}], "/@", + " ", "Coalitions"}], "]"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenUpperPayoff", "[", + RowBox[{"game_", ",", " ", "i_"}], "]"}], ":=", " ", + RowBox[{"Max", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "#", "]"}], " ", "-", " ", + RowBox[{"v", "[", + RowBox[{"DeleteCases", "[", + RowBox[{"#", ",", "i"}], "]"}], "]"}]}], ")"}], " ", "&"}], "/@", + " ", "Coalitions"}], "]"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenUpperSum", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"GenUpperSum", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GenUpperSum", "[", + RowBox[{"game_", ",", " ", "S_List"}], "]"}], ":=", " ", + RowBox[{"Plus", " ", "@@", " ", + RowBox[{"GenUpperPayoff", " ", "/@", " ", "S"}]}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"GenGap", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"GenGap", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], ";"}], "\n", RowBox[{ RowBox[{ - RowBox[{"UpperSum", "[", - RowBox[{"game_", ",", " ", "S_List"}], "]"}], ":=", " ", - RowBox[{"Plus", " ", "@@", " ", - RowBox[{"UpperPayoff", " ", "/@", " ", "S"}]}]}], ";"}]}], "Code",Expressi\ -onUUID->"d1ba148a-b599-41f0-ac95-09fcde8a922b"], - -Cell[BoxData[{ + RowBox[{ + RowBox[{"GenGap", "[", "game_", "]"}], ":=", " ", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"GenUpperSum", "[", + RowBox[{"game", ",", "#"}], "]"}], " ", "-", " ", + RowBox[{"v", "[", "#", "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", + "Coalitions"}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{ - RowBox[{"Gap", "[", "args___", "]"}], ":=", + RowBox[{"GenUpperVector", "[", "args___", "]"}], ":=", RowBox[{"(", RowBox[{ RowBox[{"Message", "[", - RowBox[{"Gap", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], - ";"}], "\n", + RowBox[{"UpperVector", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n", RowBox[{ RowBox[{ - RowBox[{"Gap", "[", "game_", "]"}], ":=", " ", RowBox[{ + RowBox[{"GenUpperVector", "[", "game_", "]"}], ":=", " ", RowBox[{ - RowBox[{"(", - RowBox[{ - RowBox[{"UpperSum", "[", - RowBox[{"game", ",", "#"}], "]"}], " ", "-", " ", - RowBox[{"v", "[", "#", "]"}]}], ")"}], " ", "&"}], " ", "/@", " ", - "Coalitions"}]}], ";"}]}], "Code",ExpressionUUID->"18fe3c2b-df6d-4867-\ -9f3b-bc3bb0f18f82"], - -Cell[BoxData[{ + RowBox[{ + RowBox[{"GenUpperPayoff", "[", + RowBox[{"game", ",", "#"}], "]"}], " ", "&"}], " ", "/@", " ", "T"}]}], + ";"}], "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{ @@ -24182,7 +25162,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"AdjustedEffVector", "[", RowBox[{"game", ",", "#"}], "]"}], " ", "&"}], " ", "/@", " ", "T"}]}], - ";"}]}], "Code",ExpressionUUID->"201eaac9-74a0-473b-b548-33709ecca15d"], + ";"}]}], "Code",ExpressionUUID->"09d88cba-52fd-423a-820a-3ce5ad9afd41"], Cell[BoxData[{ RowBox[{ @@ -24235,8 +25215,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{"Gap", "[", "game", "]"}], ",", RowBox[{"#", "+", "1"}]}], "]"}]}], " ", "&"}], " ", "/@", " ", - "T"}]}], ";"}]}], "Code",ExpressionUUID->"a37bf25b-1dbf-44e7-8ec6-\ -1045607b2c94"], + "T"}]}], ";"}]}], "Code",ExpressionUUID->"8d95ba51-9c8d-4e73-98d6-\ +2e609d1f398c"], Cell[BoxData[{ RowBox[{ @@ -24254,7 +25234,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"UpperVector", "[", "game", "]"}], " ", "-", " ", RowBox[{"Concession", "[", "game", "]"}]}]}], ";"}]}], "Code",ExpressionUU\ -ID->"258eb0bf-7e91-45b4-b46f-ca1d4e992211"], +ID->"94c91725-c89e-4c0c-87fa-151467343c25"], Cell[BoxData[{ RowBox[{ @@ -24271,9 +25251,8 @@ Cell[BoxData[{ RowBox[{"Gap", "[", "game", "]"}], ",", RowBox[{"-", "1"}]}], "]"}], " ", RowBox[{"Concession", "[", "game", "]"}]}], ")"}], "/", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", - RowBox[{"Concession", "[", "game", "]"}]}], "]"}]}]}]}], ";"}], + RowBox[{"Total", "[", + RowBox[{"Concession", "[", "game", "]"}], "]"}]}]}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{ @@ -24287,13 +25266,20 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"TauValue", "[", "game_", "]"}], ":=", " ", - RowBox[{"If", "[", + RowBox[{"Which", "[", RowBox[{ RowBox[{ RowBox[{"Last", "[", RowBox[{"Gap", "[", "game", "]"}], "]"}], "==", "0"}], ",", - RowBox[{"Tau", "[", "game", "]"}], ",", - RowBox[{"TauVal", "[", "game", "]"}]}], "]"}]}], ";"}], "\n", + RowBox[{"Tau", "[", "game", "]"}], ",", "\n", "\t\t\t", + RowBox[{ + RowBox[{"Last", "[", + RowBox[{"Gap", "[", "game", "]"}], "]"}], ">", "0"}], ",", + RowBox[{"TauVal", "[", "game", "]"}], ",", "\n", "\t\t ", "True", + ",", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", + RowBox[{"{", "}"}]}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{ @@ -24301,10 +25287,269 @@ Cell[BoxData[{ RowBox[{"UpperVector", "[", "game", "]"}]}], ";"}], "\n", "\n", RowBox[{"(*", " ", RowBox[{ - RowBox[{"section", " ", "general", " ", "k"}], "-", - RowBox[{"convex", " ", "functions", " ", "ends"}]}], " ", "*)"}], - "\n"}], "\n"}], "Code",ExpressionUUID->"e0c2d91d-13fc-4fb4-868c-\ -e157037f45b5"], + RowBox[{"Chi", "-", "Value"}], ",", " ", + RowBox[{ + RowBox[{"it", " ", "is", " ", "a", " ", "generalized", " ", "Tau"}], "-", + RowBox[{"Value", "."}]}]}], " ", "*)"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"ChiVal", "[", "game_", "]"}], ":=", " ", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", "sc", "}"}], ",", "\n", "\t\t ", + RowBox[{ + RowBox[{"sc", "=", + RowBox[{"Total", "[", + RowBox[{"GenConcession", "[", "game", "]"}], "]"}]}], ";", "\n", + "\t\t\t ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"sc", ",", "0"}], "]"}], ",", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", + + RowBox[{"{", "}"}]}], ",", "\n", "\t\t\t\t ", + RowBox[{ + RowBox[{"GenUpperVector", "[", "game", "]"}], " ", "-", " ", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"Extract", "[", + RowBox[{ + RowBox[{"GenGap", "[", "game", "]"}], ",", + RowBox[{"-", "1"}]}], "]"}], " ", + RowBox[{"GenConcession", "[", "game", "]"}]}], ")"}], "/", + "sc"}]}]}], "]"}]}]}], "\n", "\t\t\t ", "]"}]}], ";"}], + "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"ChiValue", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"ChiValue", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], + ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"ChiValue", "[", "game_", "]"}], ":=", " ", + RowBox[{"Which", "[", + RowBox[{ + RowBox[{ + RowBox[{"Last", "[", + RowBox[{"GenGap", "[", "game", "]"}], "]"}], "==", "0"}], ",", + RowBox[{"Chi", "[", "game", "]"}], ",", "\n", "\t\t\t", + RowBox[{ + RowBox[{"Last", "[", + RowBox[{"GenGap", "[", "game", "]"}], "]"}], ">", "0"}], ",", + RowBox[{"ChiVal", "[", "game", "]"}], ",", "\n", "\t\t ", "True", + ",", + RowBox[{ + RowBox[{"Print", "[", "\"\\"", "]"}], ";", + RowBox[{"{", "}"}]}]}], "]"}]}], ";"}], "\n"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"ChiValue", "[", "game_", "]"}], ":=", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{ + RowBox[{"Last", "[", + RowBox[{"GenGap", "[", "game", "]"}], "]"}], "==", "0"}], ",", + RowBox[{"Chi", "[", "game", "]"}], ",", + RowBox[{"ChiVal", "[", "game", "]"}]}], "]"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"Chi", "[", "game_", "]"}], ":=", " ", + RowBox[{"GenUpperVector", "[", "game", "]"}]}], ";"}]}], "Code",ExpressionU\ +UID->"5e333d80-40fb-4524-b806-ceb0677de26f"], + +Cell[BoxData[{ + RowBox[{ + RowBox[{ + RowBox[{"GatelyValue", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"GatelyValue", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"GatelyValue", "[", "game_", "]"}], ":=", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", + RowBox[{"dess", ",", "d", ",", "uv", ",", "vi"}], "}"}], ",", "\n", + "\t\t\t ", + RowBox[{ + RowBox[{"vi", "=", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", + RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], " ", "/@", " ", + "T"}]}], ";", "\n", "\t\t\t ", + RowBox[{"dess", " ", "=", " ", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], " ", "-", " ", + RowBox[{"Total", "[", "vi", "]"}]}]}], ";", "\n", + " ", + RowBox[{"d", "=", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"Plus", " ", "@@", " ", + RowBox[{"UpperPayoff", " ", "/@", " ", "T"}]}], " ", "-", + RowBox[{"v", "[", "T", "]"}]}], ")"}], "/", "dess"}]}], ";", "\n", + "\t\t\t ", + RowBox[{"uv", "=", + RowBox[{ + RowBox[{ + RowBox[{"UpperPayoff", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "T"}]}], ";", "\n", "\t\t\t ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{ + RowBox[{"EssentialQ", "[", "game", "]"}], ",", "True"}], "]"}], + ",", "\n", "\t\t\t ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"d", "==", "1"}], ",", + RowBox[{"{", "}"}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{"uv", "+", + RowBox[{"d", "*", "vi"}]}], ")"}], "/", + RowBox[{"(", + RowBox[{"d", "+", "1"}], ")"}]}]}], "]"}], ",", "\n", + "\t\t\t ", + RowBox[{ + RowBox[{ + "Print", "[", + "\"\\"", + "]"}], ";", + RowBox[{"{", "}"}]}]}], "]"}]}]}], "\n", "\t\t ", "]"}]}], ";"}], + "\n"}], "\n"}], "Code",ExpressionUUID->"17370861-c93f-4388-8c56-\ +0ebfe8b9b26f"], + +Cell[BoxData[ + RowBox[{"(*", " ", + RowBox[{ + RowBox[{"section", " ", "general", " ", "k"}], "-", + RowBox[{"convex", " ", "functions", " ", "ends"}]}], " ", "*)"}]], "Code",E\ +xpressionUUID->"70e6cb57-bf6a-4183-96e1-509e7b8405d1"], + +Cell[BoxData[ + RowBox[{ + RowBox[{"(*", " ", + RowBox[{"Some", " ", "Proportional", " ", "Division", " ", "Rules"}], " ", + "*)"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"PDValue", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"PDValue", "::", "argerr"}], "]"}], ";", "$Failed"}], ")"}]}], + ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"PDValue", "[", "game_", "]"}], ":=", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", + RowBox[{"vi", ",", "trQ"}], "}"}], ",", "\n", "\t\t ", + RowBox[{ + RowBox[{"vi", "=", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", + RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], " ", "/@", " ", + "T"}]}], ";", "\n", "\t\t ", + RowBox[{"trQ", "=", + RowBox[{"Apply", "[", + RowBox[{"And", ",", " ", + RowBox[{ + RowBox[{ + RowBox[{"Greater", "[", + RowBox[{"#", ",", " ", "0"}], "]"}], " ", "&"}], " ", "/@", " ", + "vi"}]}], "]"}]}], ";", "\n", "\t ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"trQ", ",", "True"}], "]"}], ",", "\n", "\t\t ", + RowBox[{ + RowBox[{"(", + RowBox[{"vi", "/", + RowBox[{"Total", "[", "vi", "]"}]}], ")"}], "*", + RowBox[{"v", "[", "T", "]"}]}], ",", "\n", "\t\t ", + RowBox[{ + RowBox[{ + "Print", "[", + "\"\\"", "]"}], ";", + RowBox[{"{", "}"}]}]}], "]"}]}]}], "\n", "\t\t ", "]"}]}], + ";"}], "\n", "\n", + RowBox[{ + RowBox[{ + RowBox[{"EPSDValue", "[", "args___", "]"}], ":=", + RowBox[{"(", + RowBox[{ + RowBox[{"Message", "[", + RowBox[{"EPSDValue", "::", "argerr"}], "]"}], ";", "$Failed"}], + ")"}]}], ";"}], "\n", + RowBox[{ + RowBox[{ + RowBox[{"EPSDValue", "[", "game_", "]"}], ":=", + RowBox[{"Block", "[", + RowBox[{ + RowBox[{"{", + RowBox[{"vi", ",", "trQ"}], "}"}], ",", "\n", "\t\t ", + RowBox[{ + RowBox[{"vi", "=", + RowBox[{ + RowBox[{ + RowBox[{"v", "[", + RowBox[{"{", "#", "}"}], "]"}], " ", "&"}], " ", "/@", " ", + "T"}]}], ";", "\n", "\t\t ", + RowBox[{"trQ", "=", + RowBox[{"Apply", "[", + RowBox[{"And", ",", " ", + RowBox[{ + RowBox[{ + RowBox[{"Greater", "[", + RowBox[{"#", ",", " ", "0"}], "]"}], " ", "&"}], " ", "/@", " ", + "vi"}]}], "]"}]}], ";", "\n", "\t\t ", + RowBox[{"Svi", "=", + RowBox[{"Total", "[", "vi", "]"}]}], ";", "\n", "\t ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{"SameQ", "[", + RowBox[{"trQ", ",", "True"}], "]"}], ",", "\n", "\t\t ", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"1", "/", + RowBox[{"Length", "[", "T", "]"}]}], ")"}], "*", "Svi"}], " ", + "+", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"vi", "/", "Svi"}], ")"}], "*", + RowBox[{"(", + RowBox[{ + RowBox[{"v", "[", "T", "]"}], "-", "Svi"}], ")"}]}]}], ",", + "\n", "\t\t ", + RowBox[{ + RowBox[{ + "Print", "[", + "\"\\ +\"", "]"}], ";", + RowBox[{"{", "}"}]}]}], "]"}]}]}], "\n", "\t\t ", "]"}]}], + ";"}]}]}]], "Code",ExpressionUUID->"b0c13e3e-d9a4-4fbf-8110-3b18f8b7134c"], Cell[BoxData[ RowBox[{ @@ -24337,7 +25582,7 @@ Cell[BoxData[ RowBox[{"Print", "[", "\"\\"", "]"}], ";", " ", RowBox[{"{", "}"}]}]}], "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->\ -"2be9ed9f-6578-4a44-a738-947c0ee80dfa"], +"d74ac2a2-7438-4fb0-b6ae-8e4e522dba7c"], Cell[BoxData[ RowBox[{ @@ -24347,7 +25592,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "DuttaRay", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -24375,13 +25620,12 @@ Cell[BoxData[ RowBox[{"Length", "[", "T", "]"}]}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"objf", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{ - RowBox[{"MapThread", "[", - RowBox[{"Subtract", ",", " ", - RowBox[{"{", - RowBox[{"vrs", ",", " ", "vN"}], "}"}]}], "]"}], "^", "2"}]}], + RowBox[{"Total", "[", + RowBox[{ + RowBox[{"MapThread", "[", + RowBox[{"Subtract", ",", " ", + RowBox[{"{", + RowBox[{"vrs", ",", " ", "vN"}], "}"}]}], "]"}], "^", "2"}], "]"}]}], ";", "\n", " ", RowBox[{"cr", " ", "=", " ", RowBox[{"Core", "[", "game", "]"}]}], ";", "\n", " ", @@ -24408,7 +25652,7 @@ Cell[BoxData[ RowBox[{"sol", ",", " ", RowBox[{"{", "__Rule", "}"}], ",", " ", "\[Infinity]"}], "]"}]}], " ", "//", " ", "Flatten"}]}]}], "\n", " ", "]"}]}], ";"}]], "Code",Ex\ -pressionUUID->"9a2d29e2-1bb7-4e61-a22d-605ea5004ab1"], +pressionUUID->"ea11f0cf-78f3-406e-8468-2ad370b7948e"], Cell[BoxData[{ RowBox[{ @@ -24427,7 +25671,7 @@ Cell[BoxData[{ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "LorenzSolution", "]"}]}]}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -24457,13 +25701,12 @@ Cell[BoxData[{ RowBox[{"Length", "[", "T", "]"}]}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"objf", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{ - RowBox[{"MapThread", "[", - RowBox[{"Subtract", ",", " ", - RowBox[{"{", - RowBox[{"vrs", ",", " ", "vN"}], "}"}]}], "]"}], "^", "2"}]}], + RowBox[{"Total", "[", + RowBox[{ + RowBox[{"MapThread", "[", + RowBox[{"Subtract", ",", " ", + RowBox[{"{", + RowBox[{"vrs", ",", " ", "vN"}], "}"}]}], "]"}], "^", "2"}], "]"}]}], ";", "\n", " ", RowBox[{"cr", " ", "=", " ", RowBox[{"If", "[", @@ -24509,7 +25752,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"MargValue", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"perm", ",", "list"}], "}"}], ",", "\n", " ", @@ -24535,7 +25778,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"pred", "[", "list_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"post", ",", "vorg", ",", "ober"}], "}"}], ",", "\n", "\t\t", @@ -24576,7 +25819,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"mengen", "[", "list_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "post", "}"}], ",", "\n", " ", RowBox[{ @@ -24611,7 +25854,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"CoreElementsQ", "[", RowBox[{"game_", ",", "payoffs_List"}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -24631,8 +25874,7 @@ Cell[BoxData[{ RowBox[{"payoffs", ",", "game"}], "]"}], ",", "\n", " ", "True", ",", " ", RowBox[{"DisplayUsageRem", "[", "payoffs", "]"}]}], "\n", " ", - "]"}]}], "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->\ -"dcba1a54-9090-4c93-bb8e-6841d31024cb"], + "]"}]}], "\n", " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"1e5bfb38-1460-4c8f-8693-36dd8b5d9626"], Cell[BoxData[ RowBox[{ @@ -24672,7 +25914,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"BalancedInequalityQ", "[", RowBox[{"game_", ",", " ", "coll_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"bcQ", ",", " ", "vS", ",", " ", "cf", ",", " ", "inQ"}], @@ -24703,7 +25945,7 @@ Cell[BoxData[ "Print", "[", "\"\\"", "]"}], ";", " ", "False"}]}], "]"}]}], ";", " ", "\n", " ", RowBox[{"Return", "[", "inQ", "]"}], ";"}]}], "\n", " ", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"360ee6a2-7888-46b5-a8c3-4e312369183f"], + ";"}]}]}]], "Code",ExpressionUUID->"8bdc3831-02a5-4cfc-a22c-6b14f72affdc"], Cell[BoxData[ RowBox[{ @@ -24728,7 +25970,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"BelongToCoreQ", "[", RowBox[{"game_", ",", " ", "payoffs_List"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -24768,7 +26010,7 @@ CoreElementsQ[game,payoffs]\>\"", "]"}], ";", "\n", " ", "Print", "[", "\"\\"", "]"}]}], ")"}]}], ";"}]}]}]], "Code",ExpressionUUI\ -D->"90366757-9982-41bf-a22a-ec88c47b5d5f"], +D->"cb0b1d5d-5db6-460b-ba0c-78b9f8b14b41"], Cell[BoxData[ RowBox[{ @@ -24777,7 +26019,7 @@ Cell[BoxData[ RowBox[{"PayList", "[", RowBox[{"game_", ",", " ", "list_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -24823,8 +26065,8 @@ Cell[BoxData[ RowBox[{"Apply", "[", RowBox[{"And", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", " ", "trueli"}]}], ";", "\n", " ", "wahrQ"}]}], "\n", " ", "]"}]}], - ";"}], "\n"}]], "Code",ExpressionUUID->"cf786647-506f-4d02-885e-\ -485c7744da73"], + ";"}], "\n"}]], "Code",ExpressionUUID->"04ab7793-2fd8-4e15-9076-\ +4192db63563d"], Cell[BoxData[{ RowBox[{ @@ -24833,7 +26075,7 @@ Cell[BoxData[{ RowBox[{"PaySole", "[", RowBox[{"game_", ",", " ", "payoff_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -24895,7 +26137,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"GameBasis", "[", "T_", "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"mgsys", ",", "gb"}], "}"}], ",", "\n", " ", @@ -24938,7 +26180,7 @@ Cell[BoxData[{ RowBox[{"coord_List", ",", "T_", ",", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", " ", @@ -24952,7 +26194,7 @@ Cell[BoxData[{ " ", "True", ",", " ", RowBox[{"WrongCoordDimension", "[", RowBox[{"coord", ",", " ", "T"}], "]"}]}], "]"}]}], "\n", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"e416466f-a693-499f-be57-79565c439e5c"], + ";"}]}], "Code",ExpressionUUID->"3f3e4fe0-c3cf-419f-a3af-a415c2b9b46a"], Cell[BoxData[{ RowBox[{ @@ -24962,19 +26204,21 @@ Cell[BoxData[{ RowBox[{"coord_List", ",", " ", "T_", ",", " ", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"tugb", ",", " ", "cval"}], "}"}], ",", "\n", " ", RowBox[{ RowBox[{"tugb", " ", "=", " ", - RowBox[{"GameBasis", "[", "T", "]"}]}], ";", "\n", + RowBox[{ + RowBox[{"GameBasis", "[", "T", "]"}], " ", "//", "N"}]}], ";", "\n", " ", RowBox[{"cval", " ", "=", " ", RowBox[{"tugb", ".", - RowBox[{"Drop", "[", - RowBox[{"coord", ",", "1"}], "]"}]}]}], ";", "\n", + RowBox[{"N", "[", + RowBox[{"Drop", "[", + RowBox[{"coord", ",", "1"}], "]"}], "]"}]}]}], ";", "\n", " ", RowBox[{"Prepend", "[", RowBox[{"cval", ",", "0"}], "]"}]}]}], "\n", "]"}]}], ";"}], @@ -24992,7 +26236,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"CoordS", "[", RowBox[{"game_", ",", "S_List"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25035,12 +26279,11 @@ Cell[BoxData[{ RowBox[{"(", RowBox[{"v", "[", "#", "]"}], ")"}], "&"}], " ", "/@", " ", RowBox[{"Subsets", "[", "S", "]"}]}]}], ";", "\n", "\t", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", - RowBox[{"MapThread", "[", - RowBox[{"Times", ",", - RowBox[{"{", - RowBox[{"koeffient", ",", "value"}], "}"}]}], "]"}]}], "]"}]}]}], + RowBox[{"Total", "[", + RowBox[{"MapThread", "[", + RowBox[{"Times", ",", + RowBox[{"{", + RowBox[{"koeffient", ",", "value"}], "}"}]}], "]"}], "]"}]}]}], "\n", "]"}]}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{ @@ -25072,7 +26315,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"HarsanyiDividends", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"gb", ",", "valvec", ",", "unc"}], "}"}], ",", "\n", @@ -25110,7 +26353,7 @@ Cell[BoxData[{ RowBox[{"coord_List", ",", "T_", ",", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "UnanConvexQ", "]"}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -25139,8 +26382,8 @@ Cell[BoxData[{ ";", "\n", " ", RowBox[{"Return", "[", "\"\\"", "]"}], ";"}]}], " ", "\n", " ", "]"}]}], "\n", "]"}]}], - ";"}], "\n"}], "Code",ExpressionUUID->"8f7e8f2f-27d8-4ea6-9366-\ -6fb319bbc017"], + ";"}], "\n"}], "Code",ExpressionUUID->"a77f7671-1d72-431d-8bf4-\ +5b409c39be69"], Cell[BoxData[ RowBox[{ @@ -25150,7 +26393,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "UnanConvexQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25221,8 +26464,8 @@ Cell[BoxData[ " ", RowBox[{"discrd", " ", "===", " ", "True"}], ",", " ", "rtnneg", ",", "\n", " ", "True", ",", " ", "trfl"}], "\n", " ", - "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"9445e14a-\ -65bc-4a43-8a2b-7d5ea6bcd28f"], + "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"ae00e533-\ +9bf6-4d9d-82cb-ea61ba31c55a"], Cell[BoxData[{ RowBox[{ @@ -25230,7 +26473,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"DetInEq", "[", RowBox[{"spij_List", ",", " ", "T_"}], "]"}], " ", ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pwset", "}"}], ",", "\n", " ", RowBox[{ @@ -25249,7 +26492,7 @@ Cell[BoxData[{ RowBox[{"InEqCond", "[", RowBox[{"splij_List", ",", " ", "submg_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25281,9 +26524,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{"\[Lambda]", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "extset"}]}], ";", "\n", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "uncoord"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"47a380d6-30b7-41cd-87c7-ea9d8f57b524"], + RowBox[{"Total", "[", "uncoord", "]"}]}]}], "\n", " ", "]"}]}], + ";"}]}], "Code",ExpressionUUID->"92aeacb6-446c-4c1f-addc-10dfdb4bd23e"], Cell[BoxData[ RowBox[{ @@ -25306,7 +26548,7 @@ Cell[BoxData[ RowBox[{"coord_List", ",", "T_", ",", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "UnanAvConvexQ", "]"}]}]}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -25321,15 +26563,15 @@ Cell[BoxData[ " ", "True", ",", " ", RowBox[{"UnanAvConvexIffCondQ", "[", RowBox[{"coord", ",", "T", ",", "opts"}], "]"}]}], "\n", " ", - "]"}]}], "\n", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"8015a13b-\ -e47a-4023-a9a5-20c3217d6a8a"], + "]"}]}], "\n", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"18bfd351-\ +78db-4d74-92d8-ae57fa600bd7"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"UnanSize2NonNegQ", "[", RowBox[{"coord_List", ",", "T_"}], "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"no", ",", "tkno"}], "}"}], ",", "\n", " ", @@ -25349,7 +26591,7 @@ Cell[BoxData[ RowBox[{"Union", "[", RowBox[{"NonNegative", "[", "tkno", "]"}], "]"}], " ", "===", " ", RowBox[{"{", "True", "}"}]}]}]}], "\n", "]"}]}], ";"}]], "Code",Express\ -ionUUID->"f84063f0-47ee-41b8-9cac-02fa03d672fd"], +ionUUID->"136731f2-e308-4377-967f-efbbeb7d0391"], Cell[BoxData[ RowBox[{ @@ -25359,7 +26601,7 @@ Cell[BoxData[ RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "UnanAvConvexQ", "]"}]}]}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25418,8 +26660,8 @@ Cell[BoxData[ RowBox[{"SameQ", "[", RowBox[{"discrd", ",", "True"}], "]"}], ",", " ", "rtnneg", ",", "\n", " ", "True", ",", " ", "trfl"}], "\n", " ", - "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"a1cce6e7-\ -874a-4189-a700-95a9178f3f4f"], + "]"}]}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"00b92373-\ +fff3-478f-8bae-b8fd43384fe6"], Cell[BoxData[ RowBox[{ @@ -25428,7 +26670,7 @@ Cell[BoxData[ RowBox[{"UnanInEquality", "[", RowBox[{"coal_List", ",", " ", "coord_List"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25527,9 +26769,8 @@ Cell[BoxData[ RowBox[{"addcrd", " ", "=", " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", " ", - "mltun"}]}], ";", "\n", " ", + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + "mltun"}]}], ";", "\n", " ", RowBox[{"lam", " ", "=", " ", RowBox[{ RowBox[{ @@ -25547,7 +26788,7 @@ Cell[BoxData[ RowBox[{"(", RowBox[{"#", " ", "/.", " ", "rlcrd"}], ")"}], " ", "&"}], " ", "/@", " ", "addcrd"}]}]}], "\n", "]"}]}], ";"}], "\n"}]], "Code",Expression\ -UUID->"97b4d873-fa4c-4e77-97e2-bb2d3f038afd"], +UUID->"6922b04f-bc92-4473-90e3-00b42b92b48a"], Cell[BoxData[ RowBox[{ @@ -25567,7 +26808,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"DetQuasiAvConvex", "[", "game_", "]"}], ":=", " ", "\n", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25613,7 +26854,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"DetUCoord", "[", RowBox[{"coord_List", ",", "T_"}], "]"}], ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\n", " ", RowBox[{"Which", "[", @@ -25646,7 +26887,7 @@ Cell[BoxData[ RowBox[{"AvCcoord", "[", RowBox[{"coord_List", ",", " ", "T_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25745,8 +26986,8 @@ Cell[BoxData[ RowBox[{"Sort", "[", RowBox[{"Apply", "[", RowBox[{"Join", ",", " ", "crdpr01"}], "]"}], "]"}]}]}], "\n", - " ", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"859e9ce6-3745-4c77-\ -835f-e050a9bb9ad4"], + " ", "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"f10de453-7453-4efc-\ +a070-209a5716206c"], Cell[BoxData[ RowBox[{ @@ -25754,7 +26995,7 @@ Cell[BoxData[ RowBox[{"MinCoordLarger2", "[", RowBox[{"coord_List", ",", " ", "setsgr2_", ",", " ", "T_"}], "]"}], " ", ":=", " ", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25798,8 +27039,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"(", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], ")"}], "/", + RowBox[{"Total", "[", "#", "]"}], ")"}], "/", RowBox[{"Length", "[", "#", "]"}]}], "-", "1"}], ")"}], " ", "&"}], " ", "/@", " ", "crdsys"}]}], ";", "\n", " ", RowBox[{"crdeq2", " ", "=", " ", @@ -25822,7 +27062,7 @@ Cell[BoxData[ RowBox[{"Min", "[", "inscrd", "]"}], ",", " ", RowBox[{"Max", "[", RowBox[{"-", "inscrd"}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]], "Code",ExpressionUUID->"b9f2db53-a0b6-45e9-b5c2-577e812a5dcf"], + ";"}]], "Code",ExpressionUUID->"4270244a-c37c-481e-ae57-e42108b075c0"], Cell[BoxData[{ RowBox[{ @@ -25837,7 +27077,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"MinUnanimityCoordinates", "[", "game_", "]"}], ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"anz", ",", "sepset"}], "}"}], ",", "\n", "\t", @@ -25883,7 +27123,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"StrictlyConvexUnanConditionQ", "[", "game_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "unanc", "}"}], ",", "\n", " ", RowBox[{ @@ -25904,7 +27144,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"ConvexUnanConditionQ", "[", "game_", "]"}], ":=", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "unanc", "}"}], ",", "\n", " ", RowBox[{ @@ -25913,14 +27153,14 @@ Cell[BoxData[{ RowBox[{"Apply", "[", RowBox[{"And", ",", RowBox[{"NonNegative", "[", "unanc", "]"}]}], "]"}]}]}], "\n", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"29079809-f48e-4186-917f-\ -c5f1016578e9"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"57adff55-dcf1-40ed-9a38-\ +2414aabba167"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"ConvexUnanIffCoord", "[", "game_", "]"}], " ", ":=", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -25977,7 +27217,7 @@ Cell[BoxData[ RowBox[{"UnanimityCoordinates", "[", "game", "]"}]}], ";", "\n", " ", RowBox[{"lams", ".", "unc"}]}]}], "\n", " ", "]"}]}], ";"}]], "Code",Ex\ -pressionUUID->"6b38cead-3822-4cd0-9ba0-f2a378f2a3fa"], +pressionUUID->"43a091e3-5f38-49df-9306-4337063e6734"], Cell[BoxData[ RowBox[{ @@ -25999,7 +27239,7 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"EvalSumMinCoord", "[", "game_", "]"}], ":=", "\n", " ", - RowBox[{"Module", "[", + RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ @@ -26082,9 +27322,8 @@ Cell[BoxData[ "]"}]}], ";", "\n", " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", + RowBox[{"Total", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", + RowBox[{"MapThread", "[", RowBox[{"Times", ",", RowBox[{"{", @@ -26111,8 +27350,8 @@ Cell[BoxData[ " ", RowBox[{"PrintMessageSec", ";", "smallestcoord"}]}], "]"}]}]}], " ", "\n", " ", "]"}]}]}], " ", "\n", " ", "]"}]}], - ";"}], "\n"}]}]], "Code",ExpressionUUID->"7833aa57-7b61-4d86-b0bd-\ -266827193fb1"], + ";"}], "\n"}]}]], "Code",ExpressionUUID->"108bbbc7-e5c8-4c75-9428-\ +fa9bcb05f25b"], Cell[BoxData[{ RowBox[{ @@ -26174,8 +27413,8 @@ equal to \>\"", ",", " ", "s0"}], "]"}], ";", "\n", " ", RowBox[{"Protect", "[", RowBox[{"Global`Co", ",", "coal"}], "]"}], ";"}], "\n", RowBox[{ - RowBox[{"Protect", "[", "Global`sij", "]"}], ";"}]}], "Code",ExpressionUUID-\ ->"b9d254cb-0b66-4a13-ba76-e5b1e941c31f"], + RowBox[{"Protect", "[", "Global`sij", "]"}], ";"}]}], "Code",ExpressionUUID->\ +"33074637-1df6-46b7-bdbc-d17c4e012299"], Cell[BoxData[{ RowBox[{ @@ -26197,13 +27436,14 @@ Cell[BoxData[{ ";"}], ",", "\n", " ", "True"}], "]"}], ";"}], "\n"}], "\n", RowBox[{ RowBox[{"EndPackage", "[", "]"}], "\n", "\n", "\n", "\n", "\n", "\n", "\n", - "\n"}], "\n"}], "Code",ExpressionUUID->"557814a3-0991-47fa-8a04-\ -dd95cb1c1851"] + "\n"}], "\n"}], "Code",ExpressionUUID->"d86c4bba-2078-4ec8-b6c6-\ +c2616a5ba742"] }, -WindowSize->{630, 827}, -WindowMargins->{{278, Automatic}, {Automatic, 82}}, -FrontEndVersion->"11.3 for Linux x86 (64-bit) (March 6, 2018)", -StyleDefinitions->"Default.nb" +WindowSize->{808, 869}, +WindowMargins->{{144, Automatic}, {91, Automatic}}, +FrontEndVersion->"12.1 for Linux x86 (64-bit) (March 18, 2020)", +StyleDefinitions->"Default.nb", +ExpressionUUID->"cae4cf0c-ccc3-4456-8b96-999806177012" ] (* End of Notebook Content *) @@ -26216,204 +27456,206 @@ CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ -Cell[558, 20, 22620, 478, 3581, "Code",ExpressionUUID->"f51a3729-20b7-447d-9c9b-e163a4ff310c"], -Cell[23181, 500, 14027, 277, 2270, "Code",ExpressionUUID->"a0016576-4667-4d02-bc22-a7645518f109"], -Cell[37211, 779, 377, 8, 70, "Code",ExpressionUUID->"5b24a71e-66bf-44ef-90c4-b6e61c261887"], -Cell[37591, 789, 503, 11, 70, "Code",ExpressionUUID->"df105406-21af-4231-a185-e20c73eeaf20"], -Cell[38097, 802, 3415, 73, 70, "Code",ExpressionUUID->"821132e2-f8bf-4c64-bdd3-113793d51d95"], -Cell[41515, 877, 2287, 57, 70, "Code",ExpressionUUID->"c6405b2f-f0c4-4fa6-bf8b-d6858178c6e6"], -Cell[43805, 936, 3517, 82, 70, "Code",ExpressionUUID->"e9f5eb75-07a2-448c-9c13-b8343724d2bc"], -Cell[47325, 1020, 410, 8, 70, "Code",ExpressionUUID->"92406f57-701f-4307-889d-ffafbc9e966d"], -Cell[47738, 1030, 2429, 66, 70, "Code",ExpressionUUID->"0bb67874-1207-4915-87eb-99cc7d33d0ef"], -Cell[50170, 1098, 4785, 90, 70, "Code",ExpressionUUID->"ab69e5f9-3599-4f3d-b0ac-c3e344cfcbec"], -Cell[54958, 1190, 553, 9, 70, "Code",ExpressionUUID->"31f398ee-4043-48f0-87e6-c761ed1f62eb"], -Cell[55514, 1201, 3388, 79, 70, "Code",ExpressionUUID->"e5c9d6a8-329d-4fc7-8d05-2a93c8dbec57"], -Cell[58905, 1282, 4750, 118, 70, "Code",ExpressionUUID->"45f36900-a18f-40a7-ac4f-81571d206f4c"], -Cell[63658, 1402, 5684, 112, 70, "Code",ExpressionUUID->"946452c8-7adc-4dcb-9f41-7403b4ed54c0"], -Cell[69345, 1516, 1130, 24, 70, "Code",ExpressionUUID->"b87b37ba-ddca-48fb-acd5-279e37a6f97d"], -Cell[70478, 1542, 384, 7, 70, "Code",ExpressionUUID->"3b4cc372-2400-4791-9eeb-aed69c911002"], -Cell[70865, 1551, 1753, 35, 70, "Code",ExpressionUUID->"6325a953-27bf-4f72-9e3b-b83799b704d5"], -Cell[72621, 1588, 454, 8, 70, "Code",ExpressionUUID->"650828de-dfc8-4cdf-a266-dacd7bc05804"], -Cell[73078, 1598, 3919, 85, 70, "Code",ExpressionUUID->"3a9f8058-0dab-4fb7-a987-14921695cc53"], -Cell[77000, 1685, 17066, 412, 70, "Code",ExpressionUUID->"bd119c4c-4da1-411e-b95d-952bb8e5484c"], -Cell[94069, 2099, 2249, 53, 70, "Code",ExpressionUUID->"513fba80-9a03-495c-994c-b3a12cda3e30"], -Cell[96321, 2154, 526, 10, 70, "Code",ExpressionUUID->"27628b26-13ca-41f6-961f-c3c3dc0acf5e"], -Cell[96850, 2166, 902, 17, 70, "Code",ExpressionUUID->"c3f6e179-f093-4d82-ac57-a16646ba8c28"], -Cell[97755, 2185, 2160, 44, 70, "Code",ExpressionUUID->"d76873cd-d9a7-47c5-9c7c-8fd9e45950c5"], -Cell[99918, 2231, 5726, 113, 70, "Code",ExpressionUUID->"0e364f94-fcf0-4cd8-b360-b74d45bead28"], -Cell[105647, 2346, 34396, 793, 70, "Code",ExpressionUUID->"82fad4f9-a56c-4299-bbce-32d2e514edb5"], -Cell[140046, 3141, 15779, 452, 70, "Code",ExpressionUUID->"b6e92997-b6a1-443d-8628-43e3ea8af988"], -Cell[155828, 3595, 8130, 230, 70, "Code",ExpressionUUID->"9a0acafa-cea2-4ecd-9e3c-5403af85442e"], -Cell[163961, 3827, 5299, 127, 70, "Code",ExpressionUUID->"0e717ca7-cebd-4a5e-a44b-0f6b63b051a3"], -Cell[169263, 3956, 5116, 120, 70, "Code",ExpressionUUID->"aa612b9a-6329-403d-aef2-2841365d5d8e"], -Cell[174382, 4078, 276, 7, 70, "Code",ExpressionUUID->"ba68b814-6e38-4272-94fd-73a2ee116e9f"], -Cell[174661, 4087, 2342, 63, 70, "Code",ExpressionUUID->"e664ca7a-46fe-492f-8a1a-1e23fcf717f6"], -Cell[177006, 4152, 1648, 49, 70, "Code",ExpressionUUID->"26cf8fe4-ac7e-4dda-af92-15942b336617"], -Cell[178657, 4203, 4871, 138, 70, "Code",ExpressionUUID->"785125cf-7683-43df-adbd-953936d8b555"], -Cell[183531, 4343, 7491, 190, 70, "Code",ExpressionUUID->"de163382-7634-4640-a2bd-126f226edd23"], -Cell[191025, 4535, 184, 3, 70, "Code",ExpressionUUID->"1bd3af4a-f881-489f-a81f-79f5bf555958"], -Cell[191212, 4540, 13081, 353, 70, "Code",ExpressionUUID->"3ec4b9ce-679d-4ad8-a69b-e6b18fb654da"], -Cell[204296, 4895, 3283, 84, 70, "Code",ExpressionUUID->"f3129a3f-0b6f-491c-a6a0-cbf6f5bdf1d1"], -Cell[207582, 4981, 1015, 28, 70, "Code",ExpressionUUID->"a811af8e-1baa-4450-bad5-90509a81725b"], -Cell[208600, 5011, 7075, 187, 70, "Code",ExpressionUUID->"f741fa4b-f9d6-4f06-87c9-12cb225cc20a"], -Cell[215678, 5200, 1135, 31, 70, "Code",ExpressionUUID->"77745ff7-1220-44f8-9d6e-f81e11dd0f6b"], -Cell[216816, 5233, 693, 19, 70, "Code",ExpressionUUID->"030a0fa4-817e-48ca-b4e0-4cd13eff7745"], -Cell[217512, 5254, 2933, 72, 70, "Code",ExpressionUUID->"88ce42e2-2e75-4a47-8e9f-a2f4677e3f1a"], -Cell[220448, 5328, 25607, 651, 70, "Code",ExpressionUUID->"311a2d97-7321-49cf-8bac-ebd887f7f824"], -Cell[246058, 5981, 4187, 112, 70, "Code",ExpressionUUID->"ff5a90b6-3677-4ef9-823d-b20a53e3d05d"], -Cell[250248, 6095, 5272, 146, 70, "Code",ExpressionUUID->"88e68efc-9d0a-49ba-9ff2-fa3c5c9a66a3"], -Cell[255523, 6243, 11692, 326, 70, "Code",ExpressionUUID->"a9de2869-c735-413b-8ef3-d841e7a26a5a"], -Cell[267218, 6571, 2517, 80, 70, "Code",ExpressionUUID->"78876d09-74e4-4a54-bc65-6b1b705fdcfb"], -Cell[269738, 6653, 4073, 117, 70, "Code",ExpressionUUID->"d1553023-3c4e-4501-b801-f44fe6503aaf"], -Cell[273814, 6772, 8899, 238, 70, "Code",ExpressionUUID->"d989a524-58f9-4b0c-a2db-0aed455c563d"], -Cell[282716, 7012, 713, 21, 70, "Code",ExpressionUUID->"509d813d-4240-4a53-a076-9ad2aabd3e3b"], -Cell[283432, 7035, 16075, 422, 70, "Code",ExpressionUUID->"1a087288-9585-4dbf-9a2e-85c3c878e040"], -Cell[299510, 7459, 12935, 329, 70, "Code",ExpressionUUID->"4c414217-5e21-473e-b27d-d5d26897680e"], -Cell[312448, 7790, 4409, 118, 70, "Code",ExpressionUUID->"4c49bb6b-54f6-4707-b7f5-61da3dc9d88a"], -Cell[316860, 7910, 813, 22, 70, "Code",ExpressionUUID->"fa1bfb32-e047-400f-8344-a6bdbe05e95a"], -Cell[317676, 7934, 1395, 29, 70, "Code",ExpressionUUID->"7ae1a06b-b039-4b6a-b32c-51da4a1c1b7a"], -Cell[319074, 7965, 7520, 191, 70, "Code",ExpressionUUID->"055de238-0718-42c2-8fcd-622779b9f379"], -Cell[326597, 8158, 7893, 200, 70, "Code",ExpressionUUID->"13f50bea-961c-4c4c-922c-b2aaec736319"], -Cell[334493, 8360, 9434, 258, 70, "Code",ExpressionUUID->"9c12d51e-b645-4d54-be22-75df1296e4cb"], -Cell[343930, 8620, 3744, 95, 70, "Code",ExpressionUUID->"3a68086e-1c4e-4bc5-b3f7-95020ef8a4fd"], -Cell[347677, 8717, 6982, 174, 70, "Code",ExpressionUUID->"3554978c-ede9-47ad-88cc-a4b0fd96b01e"], -Cell[354662, 8893, 1318, 35, 70, "Code",ExpressionUUID->"4cf65e7b-7663-444c-8db9-697dd6024a58"], -Cell[355983, 8930, 1445, 37, 70, "Code",ExpressionUUID->"a0259bcf-f7f1-44e6-8de2-3ba66fff9abc"], -Cell[357431, 8969, 5810, 139, 70, "Code",ExpressionUUID->"eb7c0fb7-46c0-43aa-b01a-c959f968db34"], -Cell[363244, 9110, 951, 24, 70, "Code",ExpressionUUID->"59baca7b-6c67-4c6f-bd34-747c1f15f144"], -Cell[364198, 9136, 3716, 96, 70, "Code",ExpressionUUID->"e38deede-c9cb-4307-8a6f-cb7feab5354f"], -Cell[367917, 9234, 1316, 34, 70, "Code",ExpressionUUID->"b95e41f6-c9ad-4dc9-aae1-a10d00c513d8"], -Cell[369236, 9270, 1902, 52, 70, "Code",ExpressionUUID->"af3034b4-4640-40a0-9cfb-437330fd521f"], -Cell[371141, 9324, 1310, 34, 70, "Code",ExpressionUUID->"5ce158f1-cd24-4e32-ab19-56c69a74090c"], -Cell[372454, 9360, 1316, 34, 70, "Code",ExpressionUUID->"8f66685c-0c84-4ae0-9e27-d3d08489cd4c"], -Cell[373773, 9396, 4807, 127, 70, "Code",ExpressionUUID->"77f04d33-d200-4812-abed-9792d4ff9898"], -Cell[378583, 9525, 7228, 195, 70, "Code",ExpressionUUID->"b0a7a988-4d1c-4492-a298-4961138667e0"], -Cell[385814, 9722, 9833, 240, 70, "Code",ExpressionUUID->"6abdba34-12b9-435f-ab75-80efae01a235"], -Cell[395650, 9964, 6201, 152, 70, "Code",ExpressionUUID->"768e2ad1-bba8-4088-9f89-def9236d5106"], -Cell[401854, 10118, 2786, 77, 70, "Code",ExpressionUUID->"a8b4d09d-32b3-4151-acc1-087d0ccf9886"], -Cell[404643, 10197, 358, 8, 70, "Code",ExpressionUUID->"bd0cc524-900b-4d58-bff5-d0475a4503dd"], -Cell[405004, 10207, 5323, 125, 70, "Code",ExpressionUUID->"1995960e-3fa6-462d-a523-349d63f0cc27"], -Cell[410330, 10334, 12037, 292, 70, "Code",ExpressionUUID->"99206110-52fd-4d3c-947c-26c3533317e3"], -Cell[422370, 10628, 10020, 254, 70, "Code",ExpressionUUID->"da93dad5-4baf-4c01-8b35-f7f98047c7c6"], -Cell[432393, 10884, 4867, 128, 70, "Code",ExpressionUUID->"4c00f903-520b-44d3-827f-b450f6723c88"], -Cell[437263, 11014, 14099, 362, 70, "Code",ExpressionUUID->"4e014cb2-d7c1-4419-a9a6-11d6e2a24062"], -Cell[451365, 11378, 364, 8, 70, "Code",ExpressionUUID->"3e8b90b0-8461-4bbd-b17b-61ac2332a21b"], -Cell[451732, 11388, 4638, 106, 70, "Code",ExpressionUUID->"bf5b1b18-879f-4d17-955f-6a3c3c790fc3"], -Cell[456373, 11496, 4749, 113, 70, "Code",ExpressionUUID->"aa35d79a-aeac-4e4e-82f7-d7b12daaf9c0"], -Cell[461125, 11611, 5694, 138, 70, "Code",ExpressionUUID->"e3a5dc11-6135-42ba-b6c1-afb05d17ac1c"], -Cell[466822, 11751, 227, 4, 70, "Code",ExpressionUUID->"efb80602-5324-4972-8c64-787423442757"], -Cell[467052, 11757, 14395, 355, 70, "Code",ExpressionUUID->"0b6b0112-b903-45df-bc35-db3f3e2a2917"], -Cell[481450, 12114, 5167, 133, 70, "Code",ExpressionUUID->"e3ae1fea-6e48-45b6-bb83-702e40830c0a"], -Cell[486620, 12249, 4713, 117, 70, "Code",ExpressionUUID->"9a4b4aa6-76ef-4db3-b797-fd14aff2c24f"], -Cell[491336, 12368, 8004, 201, 70, "Code",ExpressionUUID->"9f1451dd-37a8-4cbb-ba9a-5bfd06fea446"], -Cell[499343, 12571, 9120, 242, 70, "Code",ExpressionUUID->"df643aa7-c742-4a13-81fe-3120537d63b3"], -Cell[508466, 12815, 5144, 124, 70, "Code",ExpressionUUID->"e5abae9c-73e8-4b24-b9cb-3697c5c95a0d"], -Cell[513613, 12941, 1654, 44, 70, "Code",ExpressionUUID->"4a0e8551-6857-4d8d-ae95-a3dfb620f62e"], -Cell[515270, 12987, 5568, 132, 70, "Code",ExpressionUUID->"559493ca-b449-4a6b-9b77-e7de4e5937be"], -Cell[520841, 13121, 5774, 126, 70, "Code",ExpressionUUID->"7182ac1e-24c9-4d13-aa86-e0fae926ad55"], -Cell[526618, 13249, 4838, 112, 70, "Code",ExpressionUUID->"60a12320-b27f-42fd-b5ff-7adcbd98328c"], -Cell[531459, 13363, 3075, 74, 70, "Code",ExpressionUUID->"70f5c5ad-dc5c-4dae-a515-890effb9631c"], -Cell[534537, 13439, 14410, 365, 70, "Code",ExpressionUUID->"5b9cc908-dca1-4dc8-b91f-f4c43a203562"], -Cell[548950, 13806, 224, 5, 70, "Code",ExpressionUUID->"f9a77cc8-0bfc-4e8d-b298-412924701f88"], -Cell[549177, 13813, 2962, 72, 70, "Code",ExpressionUUID->"b9e58ddc-2cd9-4e4b-a92f-d2190e28457b"], -Cell[552142, 13887, 1955, 50, 70, "Code",ExpressionUUID->"9d5fcdb1-621e-4597-91c2-020ab1510ca3"], -Cell[554100, 13939, 1816, 47, 70, "Code",ExpressionUUID->"35a044fc-43ca-49e2-b546-d8e43632fb03"], -Cell[555919, 13988, 1773, 51, 70, "Code",ExpressionUUID->"f9f7ab91-55d3-45bc-a147-721c9ca3bdb8"], -Cell[557695, 14041, 2999, 88, 70, "Code",ExpressionUUID->"013d0d54-a369-4bc9-a3f8-c170ac56f486"], -Cell[560697, 14131, 7748, 181, 70, "Code",ExpressionUUID->"c79134b7-96a1-4dd4-b218-f944120f7397"], -Cell[568448, 14314, 23978, 579, 70, "Code",ExpressionUUID->"8d28078f-8a96-48e7-a626-828345949cf3"], -Cell[592429, 14895, 434, 11, 70, "Code",ExpressionUUID->"6e777bf9-b345-4acc-a5f7-c52509da701f"], -Cell[592866, 14908, 1697, 46, 70, "Code",ExpressionUUID->"33550466-4fa2-4eaa-90ca-02faefa63329"], -Cell[594566, 14956, 2987, 77, 70, "Code",ExpressionUUID->"9f5ef2b1-2e67-4c2e-a76b-6ebe0e355d81"], -Cell[597556, 15035, 5661, 144, 70, "Code",ExpressionUUID->"3ca45df7-6c36-45b3-ac4c-4392dabc2963"], -Cell[603220, 15181, 2317, 62, 70, "Code",ExpressionUUID->"db67bf21-521a-4702-bbfe-2c6921627047"], -Cell[605540, 15245, 5024, 119, 70, "Code",ExpressionUUID->"79d75033-cb8a-43cd-adda-8432731095a8"], -Cell[610567, 15366, 2168, 52, 70, "Code",ExpressionUUID->"aa967f6f-5240-4f34-ac50-bfb11cffd073"], -Cell[612738, 15420, 264, 5, 70, "Code",ExpressionUUID->"9e6ac50e-54f0-4901-afa9-814ba4c76b12"], -Cell[613005, 15427, 529, 13, 70, "Code",ExpressionUUID->"21463ec2-8c91-4d6c-b51f-5969f6eb8336"], -Cell[613537, 15442, 3107, 94, 70, "Code",ExpressionUUID->"a104e349-1d7d-443f-a96d-f0ab28fe33c7"], -Cell[616647, 15538, 3182, 83, 70, "Code",ExpressionUUID->"110592a5-78e9-49ad-9eb0-0bd1d23ffb80"], -Cell[619832, 15623, 3044, 77, 70, "Code",ExpressionUUID->"eadaaa23-51f3-4046-b035-d1d3c8e45bf3"], -Cell[622879, 15702, 3745, 106, 70, "Code",ExpressionUUID->"be35cfda-03d5-4168-892c-8a0c8a9a48a2"], -Cell[626627, 15810, 1974, 52, 70, "Code",ExpressionUUID->"772b1806-4bec-4e7e-93fc-a8488d1ccc35"], -Cell[628604, 15864, 3390, 89, 70, "Code",ExpressionUUID->"0755928f-5e37-4168-91bb-8ac9b5bf6d79"], -Cell[631997, 15955, 8342, 211, 70, "Code",ExpressionUUID->"6774c772-dac3-4126-baf7-e6190ddc9a2b"], -Cell[640342, 16168, 4693, 124, 70, "Code",ExpressionUUID->"a4467d5f-87ca-44c7-86c1-67853755ed8a"], -Cell[645038, 16294, 1216, 34, 70, "Code",ExpressionUUID->"ff4d4c58-86b8-4263-aa9c-a6a4b78d3f00"], -Cell[646257, 16330, 2051, 59, 70, "Code",ExpressionUUID->"e5b79220-d413-41d1-89c9-7a17e8afdd23"], -Cell[648311, 16391, 8868, 222, 70, "Code",ExpressionUUID->"7ec538f7-11dc-4fb0-95d5-af488d1e346b"], -Cell[657182, 16615, 15767, 351, 70, "Code",ExpressionUUID->"7dca1cf9-5ff5-48f9-8bb7-7c0b92decf1d"], -Cell[672952, 16968, 3366, 78, 70, "Code",ExpressionUUID->"8b7ba2dd-8312-4fab-8b1f-f596d2d8ca08"], -Cell[676321, 17048, 3559, 80, 70, "Code",ExpressionUUID->"de9645b7-2e67-4510-9c79-1bf171dc327b"], -Cell[679883, 17130, 13769, 315, 70, "Code",ExpressionUUID->"c618379c-925e-4add-9d77-00e09e6dbd42"], -Cell[693655, 17447, 8000, 201, 70, "Code",ExpressionUUID->"4d8ab4fa-0b73-4a3e-b0ad-76a7a0d6ef9b"], -Cell[701658, 17650, 5754, 149, 70, "Code",ExpressionUUID->"ab5a077f-f9fc-4b9d-a4f8-a2580589df01"], -Cell[707415, 17801, 9801, 235, 70, "Code",ExpressionUUID->"5e4f66b4-fcbe-4342-8648-1934d9d84fe4"], -Cell[717219, 18038, 5278, 124, 70, "Code",ExpressionUUID->"a70fcef0-a08b-46fe-bd8f-f1a43de97a5e"], -Cell[722500, 18164, 278, 6, 70, "Code",ExpressionUUID->"5033b483-8dc6-4b5f-9810-a3bdc45ca17d"], -Cell[722781, 18172, 2750, 64, 70, "Code",ExpressionUUID->"9ff63850-476a-46e0-9065-6df8f104c177"], -Cell[725534, 18238, 4391, 104, 70, "Code",ExpressionUUID->"ee73ba64-6a19-448a-871e-2120e1a6dec4"], -Cell[729928, 18344, 13746, 321, 70, "Code",ExpressionUUID->"35944278-9676-49da-8644-ed13e52c3f3f"], -Cell[743677, 18667, 13551, 317, 70, "Code",ExpressionUUID->"d947803d-4e23-4186-90b4-356aa6c208b5"], -Cell[757231, 18986, 5719, 133, 70, "Code",ExpressionUUID->"d77a5cf4-db78-40e8-8431-b834179d3c16"], -Cell[762953, 19121, 6174, 147, 70, "Code",ExpressionUUID->"4c1481a2-cf08-46e4-acbf-4b4f2047658f"], -Cell[769130, 19270, 4916, 115, 70, "Code",ExpressionUUID->"c12640d9-37bd-4fa8-ad1f-0f2a201b194c"], -Cell[774049, 19387, 9692, 252, 70, "Code",ExpressionUUID->"d111bbbc-2245-4fea-a541-f42f0e2ff2da"], -Cell[783744, 19641, 3433, 81, 70, "Code",ExpressionUUID->"b6ebf173-6f86-49ca-8692-d5b5927b8e49"], -Cell[787180, 19724, 3630, 86, 70, "Code",ExpressionUUID->"d20f5909-56f1-4438-8e78-17c72005f685"], -Cell[790813, 19812, 8718, 215, 70, "Code",ExpressionUUID->"53d9770e-4855-467d-aae1-d17615c7949d"], -Cell[799534, 20029, 8609, 217, 70, "Code",ExpressionUUID->"5f570a50-deea-41ec-9173-8c79df484215"], -Cell[808146, 20248, 6838, 187, 70, "Code",ExpressionUUID->"55554249-2a94-4514-acc0-132efb7eb66a"], -Cell[814987, 20437, 694, 19, 70, "Code",ExpressionUUID->"20f9e0c3-7c2d-40b5-aac0-fba46b152ec5"], -Cell[815684, 20458, 5122, 134, 70, "Code",ExpressionUUID->"fb4955fd-4e23-453c-a3a3-898ee0b392be"], -Cell[820809, 20594, 6457, 165, 70, "Code",ExpressionUUID->"ab40719e-ff5b-4cd4-87e9-87684b69d5c8"], -Cell[827269, 20761, 3152, 77, 70, "Code",ExpressionUUID->"c80742f7-93fa-446e-9e60-f7faddd8f349"], -Cell[830424, 20840, 2987, 77, 70, "Code",ExpressionUUID->"3d52fd28-02d3-4625-890e-456f26c16685"], -Cell[833414, 20919, 9163, 221, 70, "Code",ExpressionUUID->"6de11e37-dddc-4bf3-9688-c8bb2d186806"], -Cell[842580, 21142, 6254, 159, 70, "Code",ExpressionUUID->"9604ef8e-ab86-4339-a031-50715dc08dca"], -Cell[848837, 21303, 10221, 250, 70, "Code",ExpressionUUID->"c30214e8-f246-4477-a1c8-75500a4a466b"], -Cell[859061, 21555, 1081, 27, 70, "Code",ExpressionUUID->"d0c315be-0538-4824-b886-e29eb398f246"], -Cell[860145, 21584, 3533, 91, 70, "Code",ExpressionUUID->"7b3dc8b0-b8b1-47ea-959a-d9d9a2d4ee2a"], -Cell[863681, 21677, 17203, 431, 70, "Code",ExpressionUUID->"94ce0b82-30d0-4158-af3d-7994f39a82b3"], -Cell[880887, 22110, 5114, 129, 70, "Code",ExpressionUUID->"0b8c1330-9b47-4e20-a875-ce99923af091"], -Cell[886004, 22241, 6279, 163, 70, "Code",ExpressionUUID->"4ba7358c-685a-4e9f-ba4f-66d4c3ee15a9"], -Cell[892286, 22406, 17180, 430, 70, "Code",ExpressionUUID->"3df4453e-873d-4829-a34c-3033e88475dc"], -Cell[909469, 22838, 5997, 155, 70, "Code",ExpressionUUID->"80e4c9f9-14cf-412c-b37f-6004eb5ecd90"], -Cell[915469, 22995, 2920, 70, 70, "Code",ExpressionUUID->"3c8fd2a7-69b6-40f9-b749-06ce16b5ad0e"], -Cell[918392, 23067, 20408, 508, 70, "Code",ExpressionUUID->"1e6c77e7-8369-4b19-8fc7-cee551dadefe"], -Cell[938803, 23577, 374, 7, 70, "Code",ExpressionUUID->"570f2c4d-4a52-416e-8a4f-f54a150d6745"], -Cell[939180, 23586, 2512, 73, 70, "Code",ExpressionUUID->"7492aa97-0daf-4ab2-a930-bc8493468f87"], -Cell[941695, 23661, 8971, 227, 70, "Code",ExpressionUUID->"bc604488-0a62-440f-9927-55608d920c5e"], -Cell[950669, 23890, 199, 4, 70, "Code",ExpressionUUID->"7b63e066-7de8-46ac-9ee6-be47ab202172"], -Cell[950871, 23896, 238, 5, 70, "Code",ExpressionUUID->"73d6b4c5-bbf4-4d5d-9cfd-aaba647376e2"], -Cell[951112, 23903, 682, 20, 70, "Code",ExpressionUUID->"9fcb4b66-906d-4e80-9560-bc10728eb67a"], -Cell[951797, 23925, 4496, 143, 70, "Code",ExpressionUUID->"d1ba148a-b599-41f0-ac95-09fcde8a922b"], -Cell[956296, 24070, 627, 20, 70, "Code",ExpressionUUID->"18fe3c2b-df6d-4867-9f3b-bc3bb0f18f82"], -Cell[956926, 24092, 3093, 92, 70, "Code",ExpressionUUID->"201eaac9-74a0-473b-b548-33709ecca15d"], -Cell[960022, 24186, 1626, 52, 70, "Code",ExpressionUUID->"a37bf25b-1dbf-44e7-8ec6-1045607b2c94"], -Cell[961651, 24240, 559, 16, 70, "Code",ExpressionUUID->"258eb0bf-7e91-45b4-b46f-ca1d4e992211"], -Cell[962213, 24258, 1580, 48, 70, "Code",ExpressionUUID->"e0c2d91d-13fc-4fb4-868c-e157037f45b5"], -Cell[963796, 24308, 1069, 31, 70, "Code",ExpressionUUID->"2be9ed9f-6578-4a44-a738-947c0ee80dfa"], -Cell[964868, 24341, 2701, 69, 70, "Code",ExpressionUUID->"9a2d29e2-1bb7-4e61-a22d-605ea5004ab1"], -Cell[967572, 24412, 7904, 222, 70, "Code",ExpressionUUID->"dcba1a54-9090-4c93-bb8e-6841d31024cb"], -Cell[975479, 24636, 2940, 69, 70, "Code",ExpressionUUID->"360ee6a2-7888-46b5-a8c3-4e312369183f"], -Cell[978422, 24707, 2362, 63, 70, "Code",ExpressionUUID->"90366757-9982-41bf-a22a-ec88c47b5d5f"], -Cell[980787, 24772, 2072, 54, 70, "Code",ExpressionUUID->"cf786647-506f-4d02-885e-485c7744da73"], -Cell[982862, 24828, 4530, 126, 70, "Code",ExpressionUUID->"e416466f-a693-499f-be57-79565c439e5c"], -Cell[987395, 24956, 6578, 186, 70, "Code",ExpressionUUID->"8f7e8f2f-27d8-4ea6-9366-6fb319bbc017"], -Cell[993976, 25144, 3299, 80, 70, "Code",ExpressionUUID->"9445e14a-65bc-4a43-8a2b-7d5ea6bcd28f"], -Cell[997278, 25226, 2243, 59, 70, "Code",ExpressionUUID->"47a380d6-30b7-41cd-87c7-ea9d8f57b524"], -Cell[999524, 25287, 1407, 37, 70, "Code",ExpressionUUID->"8015a13b-e47a-4023-a9a5-20c3217d6a8a"], -Cell[1000934, 25326, 983, 25, 70, "Code",ExpressionUUID->"f84063f0-47ee-41b8-9cac-02fa03d672fd"], -Cell[1001920, 25353, 2738, 68, 70, "Code",ExpressionUUID->"a1cce6e7-874a-4189-a700-95a9178f3f4f"], -Cell[1004661, 25423, 4751, 126, 70, "Code",ExpressionUUID->"97b4d873-fa4c-4e77-97e2-bb2d3f038afd"], -Cell[1009415, 25551, 7485, 197, 70, "Code",ExpressionUUID->"859e9ce6-3745-4c77-835f-e050a9bb9ad4"], -Cell[1016903, 25750, 2891, 74, 70, "Code",ExpressionUUID->"b9f2db53-a0b6-45e9-b5c2-577e812a5dcf"], -Cell[1019797, 25826, 3146, 90, 70, "Code",ExpressionUUID->"29079809-f48e-4186-917f-c5f1016578e9"], -Cell[1022946, 25918, 2300, 61, 70, "Code",ExpressionUUID->"6b38cead-3822-4cd0-9ba0-f2a378f2a3fa"], -Cell[1025249, 25981, 5436, 133, 70, "Code",ExpressionUUID->"7833aa57-7b61-4d86-b0bd-266827193fb1"], -Cell[1030688, 26116, 2217, 61, 70, "Code",ExpressionUUID->"b9d254cb-0b66-4a13-ba76-e5b1e941c31f"], -Cell[1032908, 26179, 768, 21, 70, "Code",ExpressionUUID->"557814a3-0991-47fa-8a04-dd95cb1c1851"] +Cell[558, 20, 24859, 530, 3651, "Code",ExpressionUUID->"9a8aeddf-de48-46c5-8fd3-783ac9b2ee66"], +Cell[25420, 552, 15081, 300, 2305, "Code",ExpressionUUID->"ee731aa3-8b1e-4e3d-b8b7-1441a0d9c95c"], +Cell[40504, 854, 377, 8, 70, "Code",ExpressionUUID->"0a942dd6-73d8-4f51-a78a-18dbeb0b9973"], +Cell[40884, 864, 503, 11, 70, "Code",ExpressionUUID->"66d67f11-4f56-4435-8b94-78f024347417"], +Cell[41390, 877, 3415, 73, 70, "Code",ExpressionUUID->"1fb796d8-104f-432f-81e9-6abdd691b6c4"], +Cell[44808, 952, 2287, 57, 70, "Code",ExpressionUUID->"fe18ee2c-6e92-4fc1-9b47-c835f26a7275"], +Cell[47098, 1011, 3517, 82, 70, "Code",ExpressionUUID->"4a812198-4103-4011-bd95-37fb03e48b65"], +Cell[50618, 1095, 410, 8, 70, "Code",ExpressionUUID->"12893285-1219-41d4-afda-f0f777ed6b1d"], +Cell[51031, 1105, 2429, 66, 70, "Code",ExpressionUUID->"98322137-aae4-4870-9cbc-8c62b00dd9e4"], +Cell[53463, 1173, 4785, 90, 70, "Code",ExpressionUUID->"86c1efba-f1eb-41e7-a009-a06d3d919ecb"], +Cell[58251, 1265, 553, 9, 70, "Code",ExpressionUUID->"83d0b6da-e68e-4bb8-87f5-9b37d4c27963"], +Cell[58807, 1276, 3869, 90, 70, "Code",ExpressionUUID->"874de4c3-bd12-4792-aadc-c1816792c836"], +Cell[62679, 1368, 4750, 118, 70, "Code",ExpressionUUID->"e262b8da-76f9-4d39-aacf-7a7130034ede"], +Cell[67432, 1488, 5684, 112, 70, "Code",ExpressionUUID->"384b8100-b0ed-44fc-9129-488f728bdefe"], +Cell[73119, 1602, 1130, 24, 70, "Code",ExpressionUUID->"56be4b08-2581-4758-9ad8-dd98dbc3c0bf"], +Cell[74252, 1628, 384, 7, 70, "Code",ExpressionUUID->"a13b99f1-434d-45c2-95e7-4f3406f13959"], +Cell[74639, 1637, 1753, 35, 70, "Code",ExpressionUUID->"ea04aedd-1f1c-426a-833d-95cb51bcb65a"], +Cell[76395, 1674, 454, 8, 70, "Code",ExpressionUUID->"45fa5cf6-5820-47b1-9a6f-39e50692ff18"], +Cell[76852, 1684, 3919, 85, 70, "Code",ExpressionUUID->"db668b20-cafe-4c5c-b7cd-791a9dc3f4cc"], +Cell[80774, 1771, 19018, 463, 70, "Code",ExpressionUUID->"6a490d82-c3be-4fe8-8fab-8246b0a22995"], +Cell[99795, 2236, 2249, 53, 70, "Code",ExpressionUUID->"6b61ae3a-813c-4b4b-8e40-5a6fd9c67d31"], +Cell[102047, 2291, 526, 10, 70, "Code",ExpressionUUID->"6701ecd9-517f-47e0-ad49-beef46504a17"], +Cell[102576, 2303, 902, 17, 70, "Code",ExpressionUUID->"3802b4f0-eb3f-4401-95d8-217a20687ec6"], +Cell[103481, 2322, 2160, 44, 70, "Code",ExpressionUUID->"9940d43a-620f-44e7-8919-e22d68a91561"], +Cell[105644, 2368, 5726, 113, 70, "Code",ExpressionUUID->"d74e86ee-5234-4aab-8768-d85dce2e7153"], +Cell[111373, 2483, 34396, 793, 70, "Code",ExpressionUUID->"ccd3fe48-9af4-4983-8b11-06963a82487e"], +Cell[145772, 3278, 17016, 488, 70, "Code",ExpressionUUID->"7f2a3d3a-c1f3-47ed-adf0-13ae17aaf84a"], +Cell[162791, 3768, 8130, 230, 70, "Code",ExpressionUUID->"df1c807d-7253-4888-afe8-3e64e84995be"], +Cell[170924, 4000, 5299, 127, 70, "Code",ExpressionUUID->"2cba6317-c707-4694-9f14-f7726956089a"], +Cell[176226, 4129, 5116, 120, 70, "Code",ExpressionUUID->"ebcc046c-7def-496c-be8d-162a779f2ba7"], +Cell[181345, 4251, 276, 7, 70, "Code",ExpressionUUID->"fb4b8dac-9fab-4dec-bb2f-1ac0c6187c97"], +Cell[181624, 4260, 2799, 75, 70, "Code",ExpressionUUID->"ef917c83-6883-4676-b5d8-a4269646b8eb"], +Cell[184426, 4337, 1601, 48, 70, "Code",ExpressionUUID->"6a3a65d3-f4e5-469f-9fee-5befa6c032ba"], +Cell[186030, 4387, 4824, 136, 70, "Code",ExpressionUUID->"dd302531-6560-462b-83fe-f135a9eb7e79"], +Cell[190857, 4525, 5206, 134, 70, "Code",ExpressionUUID->"723d9fdf-9e76-48fd-a7d8-fcdeba73c5fd"], +Cell[196066, 4661, 1662, 42, 70, "Code",ExpressionUUID->"0852eca1-7005-42cf-9e98-e52db7d08a63"], +Cell[197731, 4705, 6361, 157, 70, "Code",ExpressionUUID->"12ab05d3-2554-4963-9d12-337cb69d96fd"], +Cell[204095, 4864, 13077, 353, 70, "Code",ExpressionUUID->"2b1dde06-8a18-487f-87aa-605b262c1642"], +Cell[217175, 5219, 959, 25, 70, "Code",ExpressionUUID->"668c0860-e5d8-4d4f-a46b-4a39838be0f4"], +Cell[218137, 5246, 3319, 86, 70, "Code",ExpressionUUID->"b15f6c52-f013-4057-8aa8-2144008642c1"], +Cell[221459, 5334, 7029, 186, 70, "Code",ExpressionUUID->"07145e91-bfa2-4949-a7f6-141fd3c66c37"], +Cell[228491, 5522, 1134, 31, 70, "Code",ExpressionUUID->"a2a7b36c-09b0-4547-83db-178591a5e58d"], +Cell[229628, 5555, 692, 19, 70, "Code",ExpressionUUID->"a11e0676-b612-411c-90f4-93fa83b5592a"], +Cell[230323, 5576, 2932, 72, 70, "Code",ExpressionUUID->"b43f9828-948d-4f34-a690-c9f3a76ee4c3"], +Cell[233258, 5650, 25265, 645, 70, "Code",ExpressionUUID->"62663577-61d8-4aaf-aaac-72ed8f153e15"], +Cell[258526, 6297, 4185, 112, 70, "Code",ExpressionUUID->"0eb4bb59-5140-4af3-8a90-807347119ea7"], +Cell[262714, 6411, 5269, 146, 70, "Code",ExpressionUUID->"2cd25c76-b2c5-4415-9b69-59eed8f878c7"], +Cell[267986, 6559, 11688, 326, 70, "Code",ExpressionUUID->"df3315ce-e262-4d0a-b102-f282e4bffcaa"], +Cell[279677, 6887, 2478, 79, 70, "Code",ExpressionUUID->"1b2fc825-7a40-4265-aaa2-cd5845cecd46"], +Cell[282158, 6968, 4040, 116, 70, "Code",ExpressionUUID->"f78b3fb1-4585-4bd2-8c1e-5b65a7957b97"], +Cell[286201, 7086, 8895, 238, 70, "Code",ExpressionUUID->"c7da071e-5179-4381-95d2-9a7b60a375d1"], +Cell[295099, 7326, 713, 21, 70, "Code",ExpressionUUID->"ab173fcb-7d5c-404d-8dbc-bf4f92563803"], +Cell[295815, 7349, 16069, 422, 70, "Code",ExpressionUUID->"b62219f2-8cdd-45c8-9baa-4eb1ddcaa6a6"], +Cell[311887, 7773, 12838, 327, 70, "Code",ExpressionUUID->"4d9fa1d3-41d5-42b6-9459-e1bd867bc816"], +Cell[324728, 8102, 4361, 117, 70, "Code",ExpressionUUID->"10e2a838-3622-4c38-9c2d-279bd708c223"], +Cell[329092, 8221, 25317, 606, 70, "Code",ExpressionUUID->"3f3fb262-e9de-43ea-b1fa-742c0fa63807"], +Cell[354412, 8829, 7524, 191, 70, "Code",ExpressionUUID->"36a9aa0a-a11a-4ecd-8bc1-2bb9aca3d337"], +Cell[361939, 9022, 7897, 200, 70, "Code",ExpressionUUID->"298a643a-08b8-46b1-8499-cfe4133eb4c9"], +Cell[369839, 9224, 9432, 258, 70, "Code",ExpressionUUID->"77086b5f-df97-47b3-a8a4-f58a7873aab1"], +Cell[379274, 9484, 3743, 95, 70, "Code",ExpressionUUID->"e26fa1d3-ddfa-45e0-a268-41a6c7633955"], +Cell[383020, 9581, 6989, 174, 70, "Code",ExpressionUUID->"00d8ceba-ad8d-4649-ae20-440e1aaaf420"], +Cell[390012, 9757, 1317, 35, 70, "Code",ExpressionUUID->"6553b23c-0a13-4f24-884b-f9231324283d"], +Cell[391332, 9794, 1444, 37, 70, "Code",ExpressionUUID->"147287c5-5ec3-4c1a-bd33-8332e5d91c71"], +Cell[392779, 9833, 5829, 139, 70, "Code",ExpressionUUID->"538e4e81-ec0c-4ea2-be70-acfb0949557a"], +Cell[398611, 9974, 951, 24, 70, "Code",ExpressionUUID->"d90ce4f9-bd2c-482b-9d25-1dfc42d6ccd4"], +Cell[399565, 10000, 3723, 96, 70, "Code",ExpressionUUID->"23550718-7e81-4c2e-bb1b-585a87b55dda"], +Cell[403291, 10098, 1315, 34, 70, "Code",ExpressionUUID->"99733a63-c8ae-4060-bc9f-7a698998475d"], +Cell[404609, 10134, 1909, 52, 70, "Code",ExpressionUUID->"821c7117-a22c-48de-8bf3-e868c28ed305"], +Cell[406521, 10188, 1309, 34, 70, "Code",ExpressionUUID->"373cb6ab-5160-4f8e-84d9-24a5605d8b5c"], +Cell[407833, 10224, 1315, 34, 70, "Code",ExpressionUUID->"6f9b49f0-e9b6-4e89-baf9-3c07d4017770"], +Cell[409151, 10260, 4813, 127, 70, "Code",ExpressionUUID->"fc4771fe-0991-4fd8-b6b1-6faab7f1613d"], +Cell[413967, 10389, 7161, 193, 70, "Code",ExpressionUUID->"c07080e1-63a6-4f9b-bfe1-4e07052575dd"], +Cell[421131, 10584, 9871, 240, 70, "Code",ExpressionUUID->"f698577e-31df-428b-9828-99f72dfa2297"], +Cell[431005, 10826, 6200, 152, 70, "Code",ExpressionUUID->"9151d9a6-4d6a-4459-92e5-c7ec1b002fdf"], +Cell[437208, 10980, 2719, 75, 70, "Code",ExpressionUUID->"2aff29c5-4799-4341-ad5c-7b8141c8f7c9"], +Cell[439930, 11057, 358, 8, 70, "Code",ExpressionUUID->"d589fbdc-b5e1-4f55-8377-8103b9754828"], +Cell[440291, 11067, 5321, 125, 70, "Code",ExpressionUUID->"c96f4d10-08dc-40e8-ba28-711f07e36de3"], +Cell[445615, 11194, 12033, 292, 70, "Code",ExpressionUUID->"73fa0979-8b65-4577-a49c-3b744bc52801"], +Cell[457651, 11488, 10016, 254, 70, "Code",ExpressionUUID->"622316fc-ae74-4302-ad57-53752f536d70"], +Cell[467670, 11744, 4865, 128, 70, "Code",ExpressionUUID->"e20a2305-e2fa-4049-a374-7faada089dbf"], +Cell[472538, 11874, 14093, 362, 70, "Code",ExpressionUUID->"03928180-a727-4a8c-bb17-cb1c4f7321af"], +Cell[486634, 12238, 364, 8, 70, "Code",ExpressionUUID->"224ba2b4-26d1-45f4-ae8c-e32c0c215ae4"], +Cell[487001, 12248, 4637, 106, 70, "Code",ExpressionUUID->"f27caabd-e6b7-4f99-ac1a-a92de1fbb8d3"], +Cell[491641, 12356, 4748, 113, 70, "Code",ExpressionUUID->"1aa5cf7c-ab32-45e0-ab29-214d9d3e8ce5"], +Cell[496392, 12471, 5693, 138, 70, "Code",ExpressionUUID->"3bfdef6b-f9f7-45a4-bd2f-f4243cf1a8fa"], +Cell[502088, 12611, 227, 4, 70, "Code",ExpressionUUID->"f2b69b09-3f30-4cb9-9279-27cd81b6e42c"], +Cell[502318, 12617, 14394, 355, 70, "Code",ExpressionUUID->"604776d5-ab93-488b-b9ab-3052bfbcbbe4"], +Cell[516715, 12974, 5165, 133, 70, "Code",ExpressionUUID->"847ae1ed-1b62-41f2-bf3e-48d3e41afdda"], +Cell[521883, 13109, 4673, 116, 70, "Code",ExpressionUUID->"e232fcbf-89f0-4d24-be08-8137dbb5dcf7"], +Cell[526559, 13227, 8003, 201, 70, "Code",ExpressionUUID->"0cfb3e80-1141-4bbd-8d86-944617936a0a"], +Cell[534565, 13430, 9115, 242, 70, "Code",ExpressionUUID->"5136f461-2fc8-47bb-9ab5-0afc1b128274"], +Cell[543683, 13674, 5143, 124, 70, "Code",ExpressionUUID->"08b20745-c0da-4994-8652-89b689258d3f"], +Cell[548829, 13800, 1653, 44, 70, "Code",ExpressionUUID->"2930bd50-358b-49c8-b430-5525232c7824"], +Cell[550485, 13846, 5567, 132, 70, "Code",ExpressionUUID->"939f0b1a-8e86-458b-ac3d-ee0a84719afc"], +Cell[556055, 13980, 5773, 126, 70, "Code",ExpressionUUID->"db8829c7-f247-4282-b638-c8d672361a59"], +Cell[561831, 14108, 4837, 112, 70, "Code",ExpressionUUID->"823c59b8-532a-4124-b45d-fe8e9c25458d"], +Cell[566671, 14222, 3074, 74, 70, "Code",ExpressionUUID->"9f7e94a9-4b90-40cd-ad9a-c783667ea36b"], +Cell[569748, 14298, 14369, 364, 70, "Code",ExpressionUUID->"833964ee-3a07-44e1-ad8e-6ce92242d710"], +Cell[584120, 14664, 224, 5, 70, "Code",ExpressionUUID->"fc0fb39b-303b-4362-9c83-3d87c28d9b0f"], +Cell[584347, 14671, 2961, 72, 70, "Code",ExpressionUUID->"a36fdb75-7493-43cb-a00c-e800bb3b582a"], +Cell[587311, 14745, 1954, 50, 70, "Code",ExpressionUUID->"e4f50c81-b0d5-420c-9c8b-646749cd93c7"], +Cell[589268, 14797, 1815, 47, 70, "Code",ExpressionUUID->"08805861-dcc9-426e-98dd-bfe18b7e308f"], +Cell[591086, 14846, 1773, 51, 70, "Code",ExpressionUUID->"1c1db585-2a69-4466-8fa4-28393a23bd2e"], +Cell[592862, 14899, 2964, 87, 70, "Code",ExpressionUUID->"9d3aa22f-598a-474e-9b6d-372feac3ef3c"], +Cell[595829, 14988, 7746, 181, 70, "Code",ExpressionUUID->"8bd7ce90-53b6-4e64-9f9d-9b8e298fc947"], +Cell[603578, 15171, 23979, 579, 70, "Code",ExpressionUUID->"31d67677-6d61-4f4a-b2aa-e0254570595d"], +Cell[627560, 15752, 434, 11, 70, "Code",ExpressionUUID->"a530db33-6ca1-436f-b70f-c4e1afd23264"], +Cell[627997, 15765, 1705, 46, 70, "Code",ExpressionUUID->"10f6bc2c-6fee-4779-afc3-e3fe74b780e0"], +Cell[629705, 15813, 3002, 78, 70, "Code",ExpressionUUID->"6755731e-c88e-48aa-984c-f149b46e666d"], +Cell[632710, 15893, 5662, 144, 70, "Code",ExpressionUUID->"24890eea-7864-4289-a989-09b3318aa435"], +Cell[638375, 16039, 2316, 62, 70, "Code",ExpressionUUID->"10530774-9cca-4907-b9c2-3de5602bf2f9"], +Cell[640694, 16103, 4985, 118, 70, "Code",ExpressionUUID->"8b9ed0af-75b9-45b1-8541-9abde0ff18ac"], +Cell[645682, 16223, 2171, 52, 70, "Code",ExpressionUUID->"cf4e1bff-04a5-440b-b403-cc110c125447"], +Cell[647856, 16277, 264, 5, 70, "Code",ExpressionUUID->"a73ba9a3-8cd0-467c-ac51-6e0471e8c7e2"], +Cell[648123, 16284, 528, 13, 70, "Code",ExpressionUUID->"e759c170-05a9-4db7-8d60-07debcd1b3ec"], +Cell[648654, 16299, 3106, 94, 70, "Code",ExpressionUUID->"fd5193e3-fc3d-46ec-9ae5-a8001774ae29"], +Cell[651763, 16395, 3181, 83, 70, "Code",ExpressionUUID->"464b66d4-8587-4fc4-b457-dae7a6fdc6d9"], +Cell[654947, 16480, 3043, 77, 70, "Code",ExpressionUUID->"f80ac963-743e-4577-942a-49884e709d96"], +Cell[657993, 16559, 3743, 106, 70, "Code",ExpressionUUID->"dd1f03ec-34bf-4a28-9475-06d627bc3aeb"], +Cell[661739, 16667, 1973, 52, 70, "Code",ExpressionUUID->"3d5f4753-337e-421a-b14f-db6c92f29223"], +Cell[663715, 16721, 3388, 89, 70, "Code",ExpressionUUID->"52c2fa25-f475-4c01-a75e-79f7794563a4"], +Cell[667106, 16812, 8340, 211, 70, "Code",ExpressionUUID->"7f265886-fe75-4793-89e3-b34dd0505bc6"], +Cell[675449, 17025, 4692, 124, 70, "Code",ExpressionUUID->"dede3bc9-2fe4-46fa-82cd-c1f05080d199"], +Cell[680144, 17151, 1215, 34, 70, "Code",ExpressionUUID->"5ac080d9-299f-41cb-8b9b-f1cff0be1606"], +Cell[681362, 17187, 2049, 59, 70, "Code",ExpressionUUID->"a8a33f99-9671-4ea1-a5fa-48b40182d10f"], +Cell[683414, 17248, 8671, 218, 70, "Code",ExpressionUUID->"cf5135e5-3133-42b9-9b28-321274676440"], +Cell[692088, 17468, 15762, 351, 70, "Code",ExpressionUUID->"79f00fb9-54fe-4759-a6a7-86435fe40cc1"], +Cell[707853, 17821, 3364, 78, 70, "Code",ExpressionUUID->"de91b94d-9b5b-4e98-90f6-73390bd17de9"], +Cell[711220, 17901, 3558, 80, 70, "Code",ExpressionUUID->"a04b2361-f555-46d1-b255-0953c6a35af6"], +Cell[714781, 17983, 13734, 314, 70, "Code",ExpressionUUID->"face353a-c5fd-4326-bd68-c18d7a85b5da"], +Cell[728518, 18299, 7964, 200, 70, "Code",ExpressionUUID->"f1bae8e6-d171-40aa-894d-21806526f333"], +Cell[736485, 18501, 5687, 147, 70, "Code",ExpressionUUID->"bfd5ad0d-ea8c-4312-b8c8-03adb89b2c42"], +Cell[742175, 18650, 9799, 235, 70, "Code",ExpressionUUID->"8dc76b1d-fea2-4327-873d-25d5a8bb30a3"], +Cell[751977, 18887, 5244, 123, 70, "Code",ExpressionUUID->"55aa10fd-83ca-421d-8337-33eae7a85469"], +Cell[757224, 19012, 278, 6, 70, "Code",ExpressionUUID->"55bf4c0d-b0d0-4e23-9ffb-a4aae48c649b"], +Cell[757505, 19020, 2749, 64, 70, "Code",ExpressionUUID->"207328ea-1065-49c6-a79e-6d645faf66ed"], +Cell[760257, 19086, 4389, 104, 70, "Code",ExpressionUUID->"df374445-3d01-4ba8-a77c-2415e39d4ff7"], +Cell[764649, 19192, 13743, 321, 70, "Code",ExpressionUUID->"6baa7855-5f0a-4983-94cd-63fe5a276c94"], +Cell[778395, 19515, 13494, 316, 70, "Code",ExpressionUUID->"42c38b22-f040-43b2-8a50-6831558234b8"], +Cell[791892, 19833, 5717, 133, 70, "Code",ExpressionUUID->"8497c984-ce0a-4cca-9ed2-52e813ba379d"], +Cell[797612, 19968, 6064, 144, 70, "Code",ExpressionUUID->"84560a71-c5d4-4aa8-a165-a5ff2d8f9389"], +Cell[803679, 20114, 4830, 113, 70, "Code",ExpressionUUID->"74244cf1-6b2d-4abb-a45e-263acec790f8"], +Cell[808512, 20229, 9691, 252, 70, "Code",ExpressionUUID->"4fdd1f54-67e0-4e6c-bc61-d1708ee5d27d"], +Cell[818206, 20483, 3433, 81, 70, "Code",ExpressionUUID->"54bbf074-e65c-4de8-944f-8f5da2c8761a"], +Cell[821642, 20566, 3629, 86, 70, "Code",ExpressionUUID->"da51dbce-4bbb-4ece-ab29-1fb07e2c64f2"], +Cell[825274, 20654, 8715, 215, 70, "Code",ExpressionUUID->"c67c9e7a-c607-411e-9f65-8864a0e5b0c8"], +Cell[833992, 20871, 8606, 217, 70, "Code",ExpressionUUID->"594185b0-1509-4202-834f-ca20ed6bd1e8"], +Cell[842601, 21090, 6832, 187, 70, "Code",ExpressionUUID->"d0f2963c-c2a6-4461-9ff9-9f6b3fefdcef"], +Cell[849436, 21279, 693, 19, 70, "Code",ExpressionUUID->"9f5fc2c5-f6ed-48fc-9cb2-6d95501e2c4c"], +Cell[850132, 21300, 5079, 133, 70, "Code",ExpressionUUID->"8a63378d-3c8c-4a5e-9f21-273cb298668d"], +Cell[855214, 21435, 6415, 164, 70, "Code",ExpressionUUID->"5cc2059a-7f98-42f9-a2a9-b797f96bc8d8"], +Cell[861632, 21601, 3152, 77, 70, "Code",ExpressionUUID->"58884a74-7d17-4a38-a271-55a5c6d7d44b"], +Cell[864787, 21680, 2987, 77, 70, "Code",ExpressionUUID->"a1d98b8c-773b-475a-8032-c695f82cd278"], +Cell[867777, 21759, 9160, 221, 70, "Code",ExpressionUUID->"69ff03b1-8790-4c96-b0cb-4288aedf3b35"], +Cell[876940, 21982, 6239, 158, 70, "Code",ExpressionUUID->"a618e868-3783-45e6-ae84-d1787028c75d"], +Cell[883182, 22142, 10173, 249, 70, "Code",ExpressionUUID->"b3c3ba4a-b100-40e9-a5b5-21556ad59fb1"], +Cell[893358, 22393, 1081, 27, 70, "Code",ExpressionUUID->"85732a78-c71f-4f13-bc39-8cb21bec3391"], +Cell[894442, 22422, 3533, 91, 70, "Code",ExpressionUUID->"0f881549-cf89-4cf1-9bf9-254354ca6ffe"], +Cell[897978, 22515, 17200, 431, 70, "Code",ExpressionUUID->"6c0878e5-ed6a-4a43-9912-f7cb21c5128f"], +Cell[915181, 22948, 5113, 129, 70, "Code",ExpressionUUID->"18ae62cd-0674-459b-9bc4-587e16868932"], +Cell[920297, 23079, 6278, 163, 70, "Code",ExpressionUUID->"ea8c0b19-5e97-4d05-8986-8b84e2acb7e8"], +Cell[926578, 23244, 17176, 430, 70, "Code",ExpressionUUID->"6dbb3bce-25b5-4633-aefd-1abf149fbe2e"], +Cell[943757, 23676, 5963, 154, 70, "Code",ExpressionUUID->"fe4e51c5-478c-4367-8b38-69de68e99c7f"], +Cell[949723, 23832, 2919, 70, 70, "Code",ExpressionUUID->"c2fa5b0f-c9a8-48ad-801a-04de17f9d1dc"], +Cell[952645, 23904, 20405, 508, 70, "Code",ExpressionUUID->"bd2ebffc-8df7-4bd5-8202-378fa08ad563"], +Cell[973053, 24414, 374, 7, 70, "Code",ExpressionUUID->"0c965ad6-eb1e-414b-bd9a-bd7b8ac1a280"], +Cell[973430, 24423, 2510, 73, 70, "Code",ExpressionUUID->"b0e2dde6-1b0b-4213-8fea-ee4335432e29"], +Cell[975943, 24498, 8967, 227, 70, "Code",ExpressionUUID->"c3f523b5-846b-4478-a560-de65201e2b46"], +Cell[984913, 24727, 199, 4, 70, "Code",ExpressionUUID->"c704d20f-39e2-402d-8b43-47992fa58862"], +Cell[985115, 24733, 238, 5, 70, "Code",ExpressionUUID->"c7c0a15d-e552-4f1d-b5e6-3bf7c9bd575d"], +Cell[985356, 24740, 682, 20, 70, "Code",ExpressionUUID->"95c1416b-9e39-4252-9fa6-5a1f09e9eeac"], +Cell[986041, 24762, 4496, 143, 70, "Code",ExpressionUUID->"b414ca33-ef05-47c8-bc95-3d9efbed2450"], +Cell[990540, 24907, 8214, 257, 70, "Code",ExpressionUUID->"09d88cba-52fd-423a-820a-3ce5ad9afd41"], +Cell[998757, 25166, 1626, 52, 70, "Code",ExpressionUUID->"8d95ba51-9c8d-4e73-98d6-2e609d1f398c"], +Cell[1000386, 25220, 559, 16, 70, "Code",ExpressionUUID->"94c91725-c89e-4c0c-87fa-151467343c25"], +Cell[1000948, 25238, 4430, 128, 70, "Code",ExpressionUUID->"5e333d80-40fb-4524-b806-ceb0677de26f"], +Cell[1005381, 25368, 2319, 67, 70, "Code",ExpressionUUID->"17370861-c93f-4388-8c56-0ebfe8b9b26f"], +Cell[1007703, 25437, 236, 5, 70, "Code",ExpressionUUID->"70e6cb57-bf6a-4183-96e1-509e7b8405d1"], +Cell[1007942, 25444, 3816, 107, 70, "Code",ExpressionUUID->"b0c13e3e-d9a4-4fbf-8110-3b18f8b7134c"], +Cell[1011761, 25553, 1069, 31, 70, "Code",ExpressionUUID->"d74ac2a2-7438-4fb0-b6ae-8e4e522dba7c"], +Cell[1012833, 25586, 2658, 68, 70, "Code",ExpressionUUID->"ea11f0cf-78f3-406e-8468-2ad370b7948e"], +Cell[1015494, 25656, 7854, 220, 70, "Code",ExpressionUUID->"1e5bfb38-1460-4c8f-8693-36dd8b5d9626"], +Cell[1023351, 25878, 2939, 69, 70, "Code",ExpressionUUID->"8bdc3831-02a5-4cfc-a22c-6b14f72affdc"], +Cell[1026293, 25949, 2361, 63, 70, "Code",ExpressionUUID->"cb0b1d5d-5db6-460b-ba0c-78b9f8b14b41"], +Cell[1028657, 26014, 2071, 54, 70, "Code",ExpressionUUID->"04ab7793-2fd8-4e15-9076-4192db63563d"], +Cell[1030731, 26070, 4527, 126, 70, "Code",ExpressionUUID->"3f3e4fe0-c3cf-419f-a3af-a415c2b9b46a"], +Cell[1035261, 26198, 6611, 187, 70, "Code",ExpressionUUID->"a77f7671-1d72-431d-8bf4-5b409c39be69"], +Cell[1041875, 26387, 3298, 80, 70, "Code",ExpressionUUID->"ae00e533-9bf6-4d9d-82cb-ea61ba31c55a"], +Cell[1045176, 26469, 2205, 58, 70, "Code",ExpressionUUID->"92aeacb6-446c-4c1f-addc-10dfdb4bd23e"], +Cell[1047384, 26529, 1406, 37, 70, "Code",ExpressionUUID->"18bfd351-78db-4d74-92d8-ae57fa600bd7"], +Cell[1048793, 26568, 982, 25, 70, "Code",ExpressionUUID->"136731f2-e308-4377-967f-efbbeb7d0391"], +Cell[1049778, 26595, 2737, 68, 70, "Code",ExpressionUUID->"00b92373-fff3-478f-8bae-b8fd43384fe6"], +Cell[1052518, 26665, 4710, 125, 70, "Code",ExpressionUUID->"6922b04f-bc92-4473-90e3-00b42b92b48a"], +Cell[1057231, 26792, 7482, 197, 70, "Code",ExpressionUUID->"f10de453-7453-4efc-a070-209a5716206c"], +Cell[1064716, 26991, 2847, 73, 70, "Code",ExpressionUUID->"4270244a-c37c-481e-ae57-e42108b075c0"], +Cell[1067566, 27066, 3143, 90, 70, "Code",ExpressionUUID->"57adff55-dcf1-40ed-9a38-2414aabba167"], +Cell[1070712, 27158, 2299, 61, 70, "Code",ExpressionUUID->"43a091e3-5f38-49df-9306-4337063e6734"], +Cell[1073014, 27221, 5394, 132, 70, "Code",ExpressionUUID->"108bbbc7-e5c8-4c75-9428-fa9bcb05f25b"], +Cell[1078411, 27355, 2217, 61, 70, "Code",ExpressionUUID->"33074637-1df6-46b7-bdbc-d17c4e012299"], +Cell[1080631, 27418, 768, 21, 70, "Code",ExpressionUUID->"d86c4bba-2078-4ec8-b6c6-c2616a5ba742"] } ] *) diff --git a/TuGames.m b/TuGames.wl similarity index 88% rename from TuGames.m rename to TuGames.wl index fa493a0..e80cb2e 100644 --- a/TuGames.m +++ b/TuGames.wl @@ -1,3 +1,5 @@ +(* ::Package:: *) + (* :Title: TuGames.m *) Off[Syntax::stresc]; Off[General::obspkg]; @@ -16,7 +18,7 @@ University of Karlsruhe (KIT) holger.meinhardt@wiwi.uni-karlsruhe.de *) -(* :Package Version: 2.5.4 *) +(* :Package Version: 2.6.0 *) (* :Mathematica Version: 8.x, 9.x, 10.x, 11.x, 12.x @@ -50,6 +52,8 @@ University of Karlsruhe (KIT) *) (* :Sources: + G. Bergantinos & J. Masso, Notes on a new compromise value: The Chi-Value, + Optimization 1996, Vol. 38, pp. 277-286. Chih Chang and Theo Driessen, (Pre)Kernel Catchers for Cooperative Games, OR Spectrum, Vol. 17, 1995 @@ -65,7 +69,7 @@ University of Karlsruhe (KIT) Publishers, Dordrecht, 1988. Theo Driessen. The Greedy Bankruptcy Game: An Alternative Game Theoretic Analysis of a Bankruptcy Problem. In - L.A. Petrosjan and V.V. Mazalov, editors, Game Theory and Applications, volume IV, pages 45–61, Commack, + L.A. Petrosjan and V.V. Mazalov, editors, Game Theory and Applications, volume IV, pages 45\[Dash]61, Commack, New York, 1998. Nova Science Publishers Inc. @@ -87,13 +91,21 @@ University of Karlsruhe (KIT) K. Kido. A nonlinear Approximation of the Nucleolus. In W. Takahashi and T. Tanaka, editors, Proceedings of the International Conference on Nonlinear Analysis and - Convex Analysis, pages 307–317, Tokyo, 2004. Yokohama Publishers, Yokohama, Japan + Convex Analysis, pages 307\[Dash]317, Tokyo, 2004. Yokohama Publishers, Yokohama, Japan K. Kido. Convergence Theorems for lp-Norm Minimizers with respect to p. Journal of - Optimization Theory and Applications, 125:577–589, 2005. + Optimization Theory and Applications, 125:577\[Dash]589, 2005. K. Kido. A Modified Kohlberg Criterion and a Nonlinear Method to compute the Nucleolus - of a Cooperative Game. Taiwanese Journal of Mathematics, 12:1581–1590, 2008. + of a Cooperative Game. Taiwanese Journal of Mathematics, 12:1581\[Dash]1590, 2008. + + M. Leng and M. Parlar. Analytic solution for the nucleolus of a three-player cooperative + game. Naval Research Logistics (NRL), 57(7):667\[Dash]672, 2010. doi: 10.1002/nav.20429. + URL https://onlinelibrary.wiley.com/doi/abs/10.1002/nav.20429. + + SC. Littlechild and KG. Vaidya, The propensity to disrupt and the disruption nucleolus + of a characteristic function game. International Journal of Game Theory 5(2):151-161, + 1976. M. Maschler, The Bargaining Set, Kernel and Nucleolus, Handbook of Game Theory, Chapter 18, 591-647, 1992. @@ -135,7 +147,7 @@ Karlsruhe Institute of Technology (KIT), Karlsruhe, Germany, 2018c. L. M. Ruiz, F. Valenciano, and J. M. Zarzuelo. The Least Square Pre-Nucleolus and the Least Square Nucleolus. Two Values for TU Games based on the Excess Vector. - International Journal of Game Theory, 25:113–134, 1996. + International Journal of Game Theory, 25:113\[Dash]134, 1996. R. T. Rockafellar, Convex Analysis, Princeton University Press, 1970. @@ -147,7 +159,7 @@ Karlsruhe Institute of Technology (KIT), Karlsruhe, Germany, 2018c. Transaction American Mathematical Society, 449-459, 1968. Sudhoelter (1997), The modified nucleolus: Properties and axiomatizations. - International Journal of Game Theory, 26 (2):147–182, Jun 1997. ISSN 1432-1270. + International Journal of Game Theory, 26 (2):147\[Dash]182, Jun 1997. ISSN 1432-1270. doi: 10.1007/BF01295846. URL https://doi.org/10.1007/BF01295846. Hal Varian (Ed.). Economics and Financial Modeling with Mathematica, @@ -218,7 +230,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Version 2.5.3 Adding some binaries for Mathematica 10.0 or later on OS X 10.9 or later. We are very grateful - to Szabolcs Horvát for providing these to the community. + to Szabolcs Horv\[AAcute]t for providing these to the community. Change of the License to the MIT License terms. @@ -252,6 +264,12 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and non-emptiness of the core is guaranteed. Recall that for n=4 we need to check 9 equivalence classes, however, for n=6 we have to check 158 classes. + Version 2.6.0: + Adding functions to compute the EPSD-Value, Chi-Value, PD-Value and the nucleolus by the Leng and Parlar (2010) formulae for three person + zero-normalized and super-additive games. Changing the package extension from *.m to *.wl. + + Performing some code maintenance and minor bug fixes. + *) @@ -285,13 +303,13 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and (* :Acknowledgment: - We are very thankful to Szabolcs Horvát for his helpful support, suggestion of improvements, + We are very thankful to Szabolcs Horv\[AAcute]t for his helpful support, suggestion of improvements, and of his piece of advice to follow best practice of publicizing a Mathematica package that allows a custom installation for everyone. Moreover, we owe him executables for MacOSX, which ship with this version. - The author acknowledge support by the state of Baden-Württemberg through bwHPC. + The author acknowledge support by the state of Baden-W\[UDoubleDot]rttemberg through bwHPC. *) @@ -300,8 +318,8 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Print["==================================================="]; Print["Loading Package 'TuGames' for ", $OperatingSystem]; Print["==================================================="]; -Print["TuGames V2.5.4 by Holger I. Meinhardt"]; -Print["Release Date: 31.05.2019"]; +Print["TuGames V2.6.0 by Holger I. Meinhardt"]; +Print["Release Date: 22.04.2020"]; Print["Program runs under Mathematica Version 8.0 or later"]; Print["Version 8.x or higher is recommended"]; Print["==================================================="];, @@ -505,6 +523,12 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ModCoalArray::usage = "ModCoalArray[game,payoff] computes a modified coalition array of first, second, ..., kth maximal excess."; +StandardSolution::usage = +"StandardSolution[game] computes the standard solution of a two-person TU-game." + +NucleolusThreePerson::usage = +"NucleolusThreePerson[game] computes the nucleolus of zero-normalized super-additive three person games. Uses the formula of Leng and Parlar (2010)." + PreNucleolus::usage = "PreNucleolus[game,options] computes the pre-nucleolus from the set of pre-imputations. The algorithm is based on a method by Peleg to translate the definition of the Nucleolus into @@ -923,6 +947,15 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Gap::usage = "Gap[game] balances the difference of the total utopia payoff of a coalition and its value."; +GenGap::usage = +"GenGap[game] balances the difference of the total generalized utopia payoff of a coalition and its value."; + +GenUpperVector::usage = + "UpperVector[game] calculates the generalized upper payoff for all players."; + +GenUpperSum::usage = + "GenUpperSum[game,S_List] calculates the sum of generalized upper payoffs for coalition S."; + AdjustedEffVector::usage = "AdjustedEffVector[game,i] calculates the adjusted efficient upper vector of player i for 1-convex games."; @@ -946,6 +979,22 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and "The TauValue[game] represents some efficient compromise between the upper bound 'Utopia-Payoff' and some lower bound 'Disagreement' of the core."; +ChiValue::usage = +"The ChiValue[game] represents some efficient compromise between the generalized upper bound 'Utopia-Payoff' + and some lower bound 'Disagreement' of the core."; + +GatelyValue::usage = +"GatelyValue[game] computes the Gately point of an essential game v."; + +PDValue::usage = +"PDValue[game] computes the proportional division value of a individually positive TU-game."; + +EPSDValue::usage = +"EPSDValue[game] computes the egalitarian proportional surplus division value of a individually positive TU-game."; + +GenConcession::usage = +"GenConcession[game] is the maximum concession of player w.r.t. his generalized utopia payoff GenUtopiaPayoff[game,i]."; + MargValue::usage = "MargValue[game] calculates the marginal worth for all players."; @@ -1243,6 +1292,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and CddVerticesImputationSet::argerr="One argument was expected."; CddVerticesLowerSet::argerr="One argument was expected."; CddVerticesReasonableSet::argerr="One argument was expected."; +ChiValue::argerr="One argument was expected."; Concession::argerr="One argument was expected."; ConvCheck::argerr="One argument was expected."; ConvexQ::argerr="One argument was expected."; @@ -1257,6 +1307,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and DualGame::argerr="One argument was expected."; DuttaRay::argerr="One argument was expected."; EpsCore::argerr="One argument was expected."; +EPSDValue::argerr="One argument was expected."; EvalSumMinCoord::argerr="One argument was expected."; FifthCriticalVal::argerr="One argument was expected."; FilledCoreV6::argerr="One argument was expected."; @@ -1267,6 +1318,11 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and GameBasis::argerr="One argument was expected."; GameMonotoneQ::argerr="One argument was expected."; Gap::argerr="One argument was expected."; +GatelyValue::argerr="One argument was expected."; +GenConcession::argerr="One argument was expected."; +GenUpperPayoff::argerr="One argument was expected."; +GenUpperSum::argerr="One argument was expected."; +GenUpperVector::argerr="One argument was expected."; GrandCoalitionLargestValueQ::argerr="One argument was expected."; HarsanyiDividends::argerr="One argument was expected."; IntersectionUpperLowerSetQ::argerr="One argument was expected."; @@ -1289,8 +1345,10 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ModPreKernel::argerr="One argument was expected."; MonotoneQ::argerr="One argument was expected."; NewShapley::argerr="One argument was expected."; +NucleolusThreePerson::argerr="One argument was expected."; Nuc1convex::argerr="One argument was expected."; OneNormalization::argerr="One argument was expected."; +PDValue::argerr="One argument was expected."; PlayerPairs::argerr="One argument was expected."; Potential::argerr="One argument was expected."; PreKernelElement::argerr="One argument was expected."; @@ -1304,6 +1362,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Quota::argerr="One argument was expected."; ReasonableOutcome::argerr="One argument was expected."; ReasonableSet::argerr="One argument was expected."; +StandardSolution::argerr="One argument was expected."; ScrbSolution::argerr="One argument was expected."; SecondCriticalVal::argerr="One argument was expected."; SecondStarCriticalVal::argerr="One argument was expected."; @@ -1329,7 +1388,6 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and UnanimityCoordinates::argerr="One argument was expected."; UpperSetIncImputationQ::argerr="One argument was expected."; UpperSetQ::argerr="One argument was expected."; -UpperVector::argerr="One argument was expected."; UtopiaVector::argerr="One argument was expected."; ValueExcess::argerr="One argument was expected."; VerticesCore::argerr="One argument was expected."; @@ -1452,7 +1510,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Uninstall[cddml]; Uninstall[cddmlgmp]; Uninstall[cddml2]; -(* We owe the following lines of code to Szabolcs Horvát. *) +(* We owe the following lines of code to Szabolcs Horv\[AAcute]t. *) (* In the second step install the cddml libraries again.*) cddml=Install@FileNameJoin[{DirectoryName[$InputFileName], "cddmathlink"}]; cddmlgmp = Install@FileNameJoin[{DirectoryName[$InputFileName], "cddmathlink2gmp"}]; @@ -1473,21 +1531,22 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and DefineGame[args___]:=(Message[DefineGame::argerr];$Failed); DefineGame[R_List, values_List, opts:OptionsPattern[DefineGame]] := (Clear[T]; T = R; Clear[v]; approxrat = OptionValue[RationalApproximate]; + If[SameQ[2^Length[T],Length[values]],True,Print["Game is not consistent defined!"];Return[]]; If[(approxrat && $VersionNumber >= 5.) == True, MapThread[Set[v[#1], #2] &, {Coalitions, Rationalize[values, 5^(-12)]}];, MapThread[Set[v[#1], #2] &, {Coalitions, values}];]); CostSaving[args___]:=(Message[CostSaving::argerr];$Failed); -CostSaving[costvec_List,T_List] := Module[{cs}, +CostSaving[costvec_List,T_List] := Block[{cs}, MapThread[SetDelayed[c[#1], #2] &, {Subsets[T], costvec}]; - cs=(Apply[Plus, c[{#}] & /@ #] - c[#]) & /@ Subsets[T]; + cs=(Total[c[{#}] & /@ #] - c[#]) & /@ Subsets[T]; Flatten[{0,Drop[cs,1]}] ]; DualGame[args___]:=(Message[DualGame::argerr];$Failed); -DualGame[game_]:=(v[T]-v[Complement[#]]& /@ Reverse[Coalitions]); +DualGame[game_]:=(v[T]-v[#] & /@ Reverse[Coalitions]); (* Def.: Let S_1,S_2,...S_k be a partition of the grand coalition T, then @@ -1498,7 +1557,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and *) WeaklySuperAdditiveQ[args___]:=(Message[WeaklySuperAdditiveQ::argerr];$Failed); -WeaklySuperAdditiveQ[game_] := Module[{truelist}, +WeaklySuperAdditiveQ[game_] := Block[{truelist}, truelist = Thread[(v[#] & /@ Coalitions) <= DualGame[game]]; Apply[And, truelist] ]; @@ -1536,13 +1595,38 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Assign[values_List]:=Thread[Rule[(v[#]& /@ Coalitions),values]]; -WeightedMajority[T_,weight_List] := Module[{outersets,coalweights,sumweights,threshold,boolval,un,trq,pos}, +WeightedMajority[T_,weight_List]:=Block[{wgs}, + Which[Depth[weight]===3, + If[SameQ[Length[Last[weight]],Length[T]], + wgs=Flatten[weight]; + Which[SameQ[Length[wgs],Length[T]+1],WeightedMajMain[T,wgs], + True,Print["Wrong Input"]], + Print["Wrong Input"]], + Depth[weight]===2,If[SameQ[Length[weight],Length[T]+1], + WeightedMajMain[T,weight], + Print["Wrong Input"]], + True,Print["Wrong Input"]] +]; + + +WeightedMajMain[T_,weight_List] := Block[{outersets,coalweights,sumweights,threshold}, + outersets = Outer[List, Subsets[T]]; + coalweights = Extract[Drop[weight,1], #] & /@ outersets; + sumweights = Total[#] & /@ coalweights; + threshold = First[weight]; + GreaterEqual[#, threshold] & /@ sumweights /. True -> 1 /. False -> 0 +]; + + + +(* +WeightedMajority[T_,weight_List] := Block[{outersets,coalweights,sumweights,threshold,boolval,un,trq,pos}, Off[Part::partd]; - outersets = Outer[List, #] & /@ Subsets[T]; + outersets = Outer[List, Subsets[T]]; coalweights = Which[Depth[weight] === 3, Extract[Flatten[Drop[weight,1]], #] & /@ outersets, Depth[weight] === 2,Extract[Drop[weight,1], #] & /@ outersets]; - sumweights = Apply[Plus, #] & /@ coalweights; + sumweights = Total[#] & /@ coalweights; threshold = Which[Depth[weight] == 3, un = Union[Flatten[{First[weight][[1]],First[weight]}]]; Which[Length[un] === 0, un, @@ -1553,9 +1637,16 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and Depth[weight] == 2, First[weight]]; On[Part::partd]; boolval = GreaterEqual[#, threshold] & /@ sumweights; - Which[# === True, 1, True, 0] & /@ boolval + boolval /. True -> 1 /. False -> 0 ]; +*) +StandardSolution[args___]:=(Message[StandardSolution::argerr];$Failed); +StandardSolution[game_]:=Module[{dmQ}, + dmQ=SameQ[2^Length[T],2^2]; + If[dmQ,v[{#}] + (v[T]-v[{1}]-v[{2}])/2 &/@ T, + Print["Game has incorrect dimension!"];Return[]] + ]; (* Section general functions ends *) @@ -1581,7 +1672,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ConvexQ[args___]:=(Message[ConvexQ::argerr];$Failed); ConvexQ[game_]:= -Module[{liste}, +Block[{liste}, liste = Flatten[IncreasingMargContributions[game,#] & /@ T,1]; Apply[And,Apply[And,liste,1]] ]; @@ -1598,14 +1689,14 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ConvexStrQ[args___]:=(Message[ConvexStrQ::argerr];$Failed); -ConvexStrQ[game_]:= Module[{liste}, +ConvexStrQ[game_]:= Block[{liste}, liste = Flatten[StrIncreasMargContrib[game,#] & /@ T,1]; Apply[And,Apply[And,liste,1]] ]; AverageConvexQ[args___]:=(Message[AverageConvexQ::argerr];$Failed); -AverageConvexQ[game_, opts:OptionsPattern[AverageConvexQ]] := Module[{dispres, pwset, chsum,delmp}, +AverageConvexQ[game_, opts:OptionsPattern[AverageConvexQ]] := Block[{dispres, pwset, chsum,delmp}, dispres = OptionValue[DisplayAllResults]; pwset = Subsets[T]; chsum = CheckSumQ[#, T, opts] & /@ Drop[pwset, 1]; @@ -1616,7 +1707,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ]; CheckSumQ[teilmg_List, T_, opts:OptionsPattern[AverageConvexQ]] := - Module[{supset, smarg, dispres}, + Block[{supset, smarg, dispres}, dispres = OptionValue[DisplayAllResults]; supset = OberMenge[teilmg, T]; smarg = SumMargContribution[#, teilmg, opts] & /@ supset; @@ -1626,7 +1717,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ]; -OberMenge[teilmg_List, T_List] := Module[{compl,subc,prop}, +OberMenge[teilmg_List, T_List] := Block[{compl,subc,prop}, compl = Complement[T, teilmg]; subc=Subsets[compl]; prop=Join[teilmg, #] & /@ subc; @@ -1634,19 +1725,19 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ]; + SumMargContribution[superset_List, teilmg_List, opts:OptionsPattern[AverageConvexQ]] := - Module[{dispres, delisp, delitlm, sumtmg, add, nnegQ}, + Block[{dispres, delisp, delitlm, sumtmg, add, nnegQ}, dispres = OptionValue[DisplayAllResults]; delisp = DeleteCases[superset, #] & /@ teilmg; delitlm = DeleteCases[teilmg, #] & /@ teilmg; - sumtmg = MapThread[(v[superset] - v[#1] - v[teilmg] + v[#2]) &, {delisp, delitlm}]; - add = Apply[Plus, sumtmg] // Simplify; + sumtmg = MapThread[N[v[superset] - v[#1] - v[teilmg] + v[#2]] &, {delisp, delitlm}]; + add = Total[sumtmg] // Simplify; nnegQ = NonNegative[add]; Which[SameQ[dispres,False], nnegQ, True, {nnegQ, add}] ]; - (* AvConvexQ[] is same as AverageConvexQ[] *) AvConvexQ[args___]:=(Message[AvConvexQ::argerr];$Failed); @@ -1662,7 +1753,7 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and (* (zero)-monotonicity section starts *) ZeroMonotoneQ[args___]:=(Message[ZeroMonotoneQ::argerr];$Failed); -ZeroMonotoneQ[game_] := Module[{zeroval, orgval,newgame,mQ,oldgame}, +ZeroMonotoneQ[game_] := Block[{zeroval, orgval,newgame,mQ,oldgame}, orgval = Rationalize[v[#] & /@ Subsets[T]]; zeroval = ZeroNormalization[game]; newgame := DefineGame[T, zeroval]; @@ -1672,22 +1763,22 @@ the least square computation of the (pre-)nucleolus by the functions LSNuc[] and ]; ZeroNormalization[args___]:=(Message[ZeroNormalization::argerr];$Failed); -ZeroNormalization[game_] := Module[{genIndVal, addIndVal, coalval}, +ZeroNormalization[game_] := Block[{genIndVal, addIndVal, coalval}, coalval = v[#] & /@ Coalitions ; genIndVal = Map[v, #] & /@ Outer[List, Coalitions]; - addIndVal = Apply[Plus, #] & /@ genIndVal; + addIndVal = Total[#] & /@ genIndVal; Subtract[coalval, addIndVal] ]; ZeroOneNormalization[args___]:=(Message[ZeroOneNormalization::argerr];$Failed); -ZeroOneNormalization[game_] := Module[{zeroli, div}, +ZeroOneNormalization[game_] := Block[{zeroli, div}, zeroli = ZeroNormalization[game]; div = Divide[ #, Take[zeroli, -1]] & /@ zeroli; Flatten[div] ]; OneNormalization[args___]:=(Message[OneNormalization::argerr];$Failed); -OneNormalization[game_] := Module[{newgame}, +OneNormalization[game_] := Block[{newgame}, newgame = v[#] & /@ Subsets[T]; newgame * (1/Last[newgame]) @@ -1699,14 +1790,14 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. GameMonotoneQ[args___]:=(Message[GameMonotoneQ::argerr];$Failed); GameMonotoneQ[game_]:= -Module[{liste}, +Block[{liste}, liste = Flatten[MargContribPositive[game,#] & /@ T,1]; Apply[And,Apply[And,liste,1]] ]; -MargContribPositive[game_,i_Integer]:= Module[{margli}, +MargContribPositive[game_,i_Integer]:= Block[{margli}, margli = ( v[#]-v[DeleteCases[#,i]])& /@ W[i]; MapThread[GreaterEqual,{margli,Table[0,{j,Length[margli]}]}] ]; @@ -1714,7 +1805,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. MonotoneQ[args___]:=(Message[MonotoneQ::argerr];$Failed); -MonotoneQ[game_] := Module[{coal}, +MonotoneQ[game_] := Block[{coal}, coal = Coalitions; MonoCheck[game, coal] ]; @@ -1723,7 +1814,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* Checks monotonicity for every subgame *) MonoCheck[game_, liste_] := - Module[{mengen = liste, obermenge, gensub, newsets, val, pruef,truelist = {}, wahrQ}, + Block[{mengen = liste, obermenge, gensub, newsets, val, pruef,truelist = {}, wahrQ}, While[Length[mengen] > 0, obermenge = Take[mengen, -1][[1]]; newsets = DeleteCases[mengen, obermenge]; @@ -1759,7 +1850,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* The following critical values are due to Maschler, Peleg and Shapley (1979) *) FirstCriticalVal[args___]:=(Message[FirstCriticalVal::argerr];$Failed); -FirstCriticalVal[game_] := Module[{con}, +FirstCriticalVal[game_] := Block[{con}, con = ConstrainedMin[e - f, Append[ NewRelax[CoalitionalRationality, e - f], ParetoOptimality], Join[PayoffVector, {e, f}]]; @@ -1767,29 +1858,29 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; SecondCriticalVal[args___]:=(Message[SecondCriticalVal::argerr];$Failed); -SecondCriticalVal[game_] := Module[{cval2}, - cval2 = Max[(v[#] - Apply[Plus, Map[v[{#1}] &, #]]) & /@ ProperCoalitions]; +SecondCriticalVal[game_] := Block[{cval2}, + cval2 = Max[(v[#] - Total[Map[v[{#1}] &, #]]) & /@ ProperCoalitions]; MapThread[Rule, {{Global`eps2}, {cval2}}] ]; ThirdCriticalVal[args___]:=(Message[ThirdCriticalVal::argerr];$Failed); -ThirdCriticalVal[game_] := Module[{cval3}, +ThirdCriticalVal[game_] := Block[{cval3}, ReasonableOutcome[game]; - cval3 = Max[(v[#] - v[T] + Apply[Plus, Map[Global`r[#1] &, Complement[T,#]]]) & /@ ProperCoalitions]; + cval3 = Max[(v[#] - v[T] + Total[Map[Global`r[#1] &, Complement[T,#]]]) & /@ ProperCoalitions]; MapThread[Rule, {{Global`eps3}, {cval3}}] ]; FourthCriticalVal[args___]:=(Message[FourthCriticalVal::argerr];$Failed); -FourthCriticalVal[game_]:= Module[{cval4}, +FourthCriticalVal[game_]:= Block[{cval4}, cval4 = Min[{SecondCriticalVal[game][[1,2]],ThirdCriticalVal[game][[1,2]]}]; MapThread[Rule, {{Global`eps4}, {cval4}}] ]; StarCriticalVal[args___]:=(Message[StarCriticalVal::argerr];$Failed); -StarCriticalVal[game_] :=Module[{cval, upbd}, +StarCriticalVal[game_] :=Block[{cval, upbd}, upbd = MapThread[Rule, {up[#] & /@ T, ReasonableOutcome[game]}]; - cval = Max[Min[{v[#] - Apply[Plus, v[{#1}] & /@ #], + cval = Max[Min[{v[#] - Total[v[{#1}] & /@ #], v[#] + (up[Complement[T, #]] /. upbd) - v[T]}] & /@ ProperCoalitions]; MapThread[Rule, {{Global`stareps}, {cval}}] @@ -1802,7 +1893,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* The next two critical values are defined by Chang and Kan (1992) and Chang and Driessen (1994) *) SecondStarCriticalVal[args___]:=(Message[SecondStarCriticalVal::argerr];$Failed); -SecondStarCriticalVal[game_] := Module[{lwbd, lwpara, upbd, uppara, dstarcval}, +SecondStarCriticalVal[game_] := Block[{lwbd, lwpara, upbd, uppara, dstarcval}, lwbd = SmallestContributionVector[game]; lwpara = MapThread[Rule, {m[#] & /@ T, lwbd}]; upbd = ReasonableOutcome[game]; @@ -1818,7 +1909,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; ThirdStarCriticalVal[args___]:=(Message[ThirdStarCriticalVal::argerr];$Failed); -ThirdStarCriticalVal[game_] := Module[{lwbd, lwpara, upbd, uppara, thstarcval}, +ThirdStarCriticalVal[game_] := Block[{lwbd, lwpara, upbd, uppara, thstarcval}, lwbd = SmallestContributionVector[game]; lwpara = MapThread[Rule, {m[#] & /@ T, lwbd}]; upbd = ProperAmount[game]; @@ -1833,14 +1924,14 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. MapThread[Rule, {{Global`thstareps}, {thstarcval}}] ]; -CaseOne[game_, uppara_List] := Module[{},Max[Min[{(v[#] + up[Complement[T, #]] - v[T]), v[#] - Apply[Plus, v[{#1}] & /@ #], 0}] & /@ ProperCoalitions /. uppara]]; -CaseTwo[game_, lwpara_List, uppara_List] := Module[{}, Max[Min[{v[#] - m[#], v[#] - Apply[Plus, v[{#1}] & /@ #], v[#] + up[Complement[T, #]] - v[T]}] & /@ ProperCoalitions /. lwpara /. uppara]]; -CaseThree[game_, lwpara_List, uppara_List] := Module[{},Max[Min[{Max[{v[#] - m[#], 0}], v[#] - Apply[Plus, v[{#1}] & /@ #], (v[#] + up[Complement[T, #]] - v[T])}] & /@ ProperCoalitions /. lwpara /. uppara]]; -CaseThreeFor3[game_, lwpara_List, uppara_List] := Module[{},Max[Min[{Max[{Min[{v[#] - Apply[Plus, v[{#1}] & /@ #],v[#] - m[#]}],0}], Max[{(v[#] + up[Complement[T, #]] - v[T]),0}]}] & /@ ProperCoalitions /. lwpara /. uppara]]; +CaseOne[game_, uppara_List] := Block[{},Max[Min[{(v[#] + up[Complement[T, #]] - v[T]), v[#] - Total[v[{#1}] & /@ #], 0}] & /@ ProperCoalitions /. uppara]]; +CaseTwo[game_, lwpara_List, uppara_List] := Block[{}, Max[Min[{v[#] - m[#], v[#] - Total[v[{#1}] & /@ #], v[#] + up[Complement[T, #]] - v[T]}] & /@ ProperCoalitions /. lwpara /. uppara]]; +CaseThree[game_, lwpara_List, uppara_List] := Block[{},Max[Min[{Max[{v[#] - m[#], 0}], v[#] - Total[v[{#1}] & /@ #], (v[#] + up[Complement[T, #]] - v[T])}] & /@ ProperCoalitions /. lwpara /. uppara]]; +CaseThreeFor3[game_, lwpara_List, uppara_List] := Block[{},Max[Min[{Max[{Min[{v[#] - Total[v[{#1}] & /@ #],v[#] - m[#]}],0}], Max[{(v[#] + up[Complement[T, #]] - v[T]),0}]}] & /@ ProperCoalitions /. lwpara /. uppara]]; FifthCriticalVal[args___]:=(Message[FifthCriticalVal::argerr];$Failed); -FifthCriticalVal[game_] := Module[{lwbd, lwpara,cval5}, +FifthCriticalVal[game_] := Block[{lwbd, lwpara,cval5}, lwbd = SmallestContributionVector[game]; lwpara = MapThread[Rule, {m[#] & /@ T, lwbd}]; cval5=Which[LowerSetQ[game] === False, 0, @@ -1852,7 +1943,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; UpperSetQ[args___]:=(Message[UpperSetQ::argerr];$Failed); -UpperSetQ[game_] := Module[{upbd,uppara}, +UpperSetQ[game_] := Block[{upbd,uppara}, upbd = ProperAmount[game]; uppara = MapThread[Rule, {up[#] & /@ T, upbd}]; (up[T] /. uppara) >= v[T] @@ -1860,14 +1951,14 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. LowerSetQ[args___]:=(Message[LowerSetQ::argerr];$Failed); -LowerSetQ[game_] := Module[{lwbd, lwpara}, +LowerSetQ[game_] := Block[{lwbd, lwpara}, lwbd = SmallestContributionVector[game]; lwpara = MapThread[Rule, {m[#] & /@ T, lwbd}]; (m[T] /. lwpara) <= v[T] ]; LowerSetIncImputationQ[args___]:=(Message[LowerSetIncImputationQ::argerr];$Failed); -LowerSetIncImputationQ[game_,opts:OptionsPattern[LowerSetIncImputationQ]] := Module[{sil}, +LowerSetIncImputationQ[game_,opts:OptionsPattern[LowerSetIncImputationQ]] := Block[{sil}, sil = OptionValue[Silent]; Which[SameQ[sil,False],DisplayMessageLower;True]; Min[SmallestContributionVector[game]] >= 0 @@ -1877,7 +1968,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. Print["True is equivalent to zero-monotonicity of the game."];); UpperSetIncImputationQ[args___]:=(Message[UpperSetIncImputationQ::argerr];$Failed); -UpperSetIncImputationQ[game_,opts:OptionsPattern[UpperSetIncImputationQ]] := Module[{sil,prub, prpara, setwoi}, +UpperSetIncImputationQ[game_,opts:OptionsPattern[UpperSetIncImputationQ]] := Block[{sil,prub, prpara, setwoi}, sil = OptionValue[Silent]; Which[UpperSetQ[game] === True, prub = ProperAmount[game]; @@ -1894,17 +1985,17 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. IntersectionUpperLowerSetQ[args___]:=(Message[IntersectionUpperLowerSetQ::argerr];$Failed); -IntersectionUpperLowerSetQ[game_] := Module[{}, +IntersectionUpperLowerSetQ[game_] := Block[{}, LowerSetQ[game] && UpperSetQ[game] ]; GrandCoalitionLargestValueQ[args___]:=(Message[GrandCoalitionLargestValueQ::argerr];$Failed); -GrandCoalitionLargestValueQ[game_] := Module[{}, +GrandCoalitionLargestValueQ[game_] := Block[{}, Max[v[#] &/@ Subsets[T]] <= v[T] ]; PreKernelEqualsKernelQ[args___]:=(Message[PreKernelEqualsKernelQ::argerr];$Failed); -PreKernelEqualsKernelQ[game_,opts:OptionsPattern[PreKernelEqualsKernelQ]] := Module[{sil}, +PreKernelEqualsKernelQ[game_,opts:OptionsPattern[PreKernelEqualsKernelQ]] := Block[{sil}, sil = OptionValue[Silent]; Which[sil===False, Switch[True, ZeroMonotoneQ[game],PrintMessPreKernelEq01; True, @@ -1952,7 +2043,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ReasonableConst := x[#] <= Global`r[#] & /@ T; ReasonableSet[args___]:=(Message[ReasonableSet::argerr];$Failed); -ReasonableSet[game_] := Module[{assr}, +ReasonableSet[game_] := Block[{assr}, ReasonableOutcome[game]; assr = (Clear[Global`r]; MapThread[Set, {ImplementReas[game], LargestAmount[game]}]); Append[ReasonableConst, ParetoOptimality] @@ -1963,7 +2054,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. NewShapley[args___]:=(Message[NewShapley::argerr];$Failed); -NewShapley[game_]:=Module[{pot}, +NewShapley[game_]:=Block[{pot}, pot=Potential[game]; Last[pot,1]-Part[pot,-#-1] &/@ T ]; @@ -1973,11 +2064,11 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. rho[{}]:=0; rho[S_List /; Length[S]==1]:=rho[S]=v[S]; -rho[S_List /; Length[S]>1]:=rho[S]=(v[S]+Apply[Plus,rho[DeleteCases[S,#]] &/@ S])/Length[S]; +rho[S_List /; Length[S]>1]:=rho[S]=(v[S]+Total[rho[DeleteCases[S,#]] &/@ S])/Length[S]; ShapleyValueML[args___]:=(Message[ShapleyValueML::argerr];$Failed); -ShapleyValueML[game_]:=Module[{vars,tv,rl,F,dmat,G}, +ShapleyValueML[game_]:=Block[{vars,tv,rl,F,dmat,G}, vars=x[#] &/@ T; tv=Array[t &,Length[T]]; rl=MapThread[Rule,{vars,tv}]; @@ -1988,13 +2079,13 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; MLExtension[args___]:=(Message[MLExtension::argerr];$Failed); -MLExtension[game_]:=Module[{ss,cS,ms,ns,smd}, +MLExtension[game_]:=Block[{ss,cS,ms,ns,smd}, ss=Subsets[T]; cS=Reverse[ss]; ms=MapThread[x,{#}] &/@ ss; ns=MapThread[x,{#}] &/@ cS; smd=Table[(Apply[Times,ms[[i]]]*Apply[Times,Subtract[1,#] &/@ ns[[i]]])*v[ss[[i]]],{i,Length[ms]}]; - Apply[Plus,smd] + Total[smd] ]; @@ -2007,7 +2098,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ); ExcessPayoff[args___]:=(Message[ExcessPayoff::argerr];$Failed); -ExcessPayoff[game_,payoff_List, opts:OptionsPattern[ExcessPayoff]]:= Module[{dispmat,assg,li,res}, +ExcessPayoff[game_,payoff_List, opts:OptionsPattern[ExcessPayoff]]:= Block[{dispmat,assg,li,res}, dispmat = OptionValue[DisplayMatrixForm]; If[Depth[payoff] == 2 || Depth[payoff] == 3, li = If[Length[Dimensions[payoff]]==1,{payoff},payoff]; @@ -2018,7 +2109,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ] ]; -DisplayErgb[payoff_List]:= Module[{exc,coal,mpc}, +DisplayErgb[payoff_List]:= Block[{exc,coal,mpc}, exc = payoff; coal = Subsets[T]; mpc = Map[Global`Co,coal]; @@ -2026,7 +2117,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; MaxExcessSets[args___]:=(Message[MaxExcessSets::argerr];$Failed); -MaxExcessSets[game_, payoff_List] := Module[{exclist, propexc, maxexc, pos}, +MaxExcessSets[game_, payoff_List] := Block[{exclist, propexc, maxexc, pos}, exclist = ExcessPayoff[game, payoff]; propexc = Drop[Drop[#, 1], -1] & /@ exclist; maxexc = Max[#] & /@ propexc; @@ -2035,7 +2126,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; IntersectionOfMaxExcessSets[args___]:=(Message[IntersectionOfMaxExcessSets::argerr];$Failed); -IntersectionOfMaxExcessSets[game_, payoff_List] := Module[{dsets}, +IntersectionOfMaxExcessSets[game_, payoff_List] := Block[{dsets}, dsets = MaxExcessSets[game, payoff]; Which[GrandCoalitionLargestValueQ[game]===False,DisplayMessFalse[game,payoff], True, DisplayMessTrue[game,payoff]]; @@ -2055,7 +2146,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. MaxExcessBalanced[args___]:=(Message[MaxExcessBalanced::argerr];$Failed); -MaxExcessBalanced[game_, payoff_List]:= Module[{dimpay}, +MaxExcessBalanced[game_, payoff_List]:= Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay] === 2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3), MaxExcessBalCheck[game, #] & /@ payoff, @@ -2067,7 +2158,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; MaxExcessBalCheck[game_,payoff_List]:= - Module[{plpr,rvpr,asspay,sij,sji,msrplij,msrplji,msrij,msrji,lthij,tolvec,sysij,sysji,eqQ}, + Block[{plpr,rvpr,asspay,sij,sji,msrplij,msrplji,msrij,msrji,lthij,tolvec,sysij,sysji,eqQ}, plpr = PlayerPairs[T]; rvpr = Reverse[#] & /@ plpr; asspay = AssgPay[payoff]; @@ -2084,7 +2175,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; MinExcessBalanced[args___]:=(Message[MinExcessBalanced::argerr];$Failed); -MinExcessBalanced[game_, payoff_List]:= Module[{dimpay}, +MinExcessBalanced[game_, payoff_List]:= Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay] === 2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3), MinExcessBalCheck[game, #] & /@ payoff, @@ -2096,7 +2187,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; MinExcessBalCheck[game_,payoff_List]:= - Module[{plpr, rvpr, asspay,sij,sji,msrplij,msrplji,msrij, msrji,lthij,tolvec,sysij,sysji,eqQ}, + Block[{plpr, rvpr, asspay,sij,sji,msrplij,msrplji,msrij, msrji,lthij,tolvec,sysij,sysji,eqQ}, plpr = PlayerPairs[T]; rvpr = Reverse[#] & /@ plpr; asspay = AssgPay[payoff]; @@ -2113,7 +2204,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; Quota[args___]:=(Message[Quota::argerr];$Failed); -Quota[game_]:= Module[{secsize,matrix}, +Quota[game_]:= Block[{secsize,matrix}, secsize = Reverse[v[DeleteCases[T,#]] & /@ T]; matrix = Reverse[Table[If[i==j,0,1],{i,Length[T]},{j,Length[T]}]]; LinearSolve[matrix,secsize] @@ -2121,7 +2212,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. VerticesCore[args___]:=(Message[VerticesCore::argerr];$Failed); VerticesCore[game_]:= - Module[{liste,mat,values}, + Block[{liste,mat,values}, liste = Table[If[i>=j,1,0],{i,Length[T]},{j,Length[T]}]; mat = Flatten[Permutations[#] & /@ liste,1]; AppendTo[mat, -Last[mat]]; @@ -2141,7 +2232,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. If[SameQ[essgQ,False],Print["No solution can be found. Game not essential"];Return[{}]]; propsets = ProperCoalitions; const01 = Flatten[x[{#}] + Global`\[Alpha] >= v[#] & /@ propsets]; - const02 = MapThread[Equal, {{Apply[Plus, x[#] & /@ T]}, {v[T]}}]; + const02 = MapThread[Equal, {{Total[x[#] & /@ T]}, {v[T]}}]; const = FlattenAt[Append[const01, const02], Length[const01] + 1]; var = FlattenAt[{Global`\[Alpha], x /@ T}, 2]; {obf, cmat, bvect} = LPtoMatrix[Global`\[Alpha], const, var]; @@ -2164,12 +2255,12 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ModifiedKernel[args___]:=(Message[ModifiedKernel::argerr];$Failed); ModifiedKernel[game_, opts:OptionsPattern[ModifiedKernel]] := - Module[{essgQ,propsets,const01,const02,const,var,obf,cmat,bvect,pra,minf,bds,ubds,blg,pbd,zv,rl}, + Block[{essgQ,propsets,const01,const02,const,var,obf,cmat,bvect,pra,minf,bds,ubds,blg,pbd,zv,rl}, essgQ=EssentialQ[game]; If[SameQ[essgQ,False],Print["No solution can be found. Game not essential"];Return[{}]]; propsets = ProperCoalitions; const01 = Flatten[x[{#}] + Global`\[Alpha] >= v[#] & /@ propsets]; - const02 = MapThread[Equal, {{Apply[Plus, x[#] & /@ T]}, {v[T]}}]; + const02 = MapThread[Equal, {{Total[x[#] & /@ T]}, {v[T]}}]; const = FlattenAt[Append[const01, const02], Length[const01] + 1]; var = FlattenAt[{Global`\[Alpha], x /@ T}, 2]; {obf, cmat, bvect} = LPtoMatrix[Global`\[Alpha], const, var]; @@ -2192,10 +2283,10 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. PreNucleolus[args___]:=(Message[PreNucleolus::argerr];$Failed); PreNucleolus[game_, opts:OptionsPattern[PreNucleolus]] := - Module[{propsets,const01,const02,const,var,obf, cmat, bvect,pra,minf,bds}, + Block[{propsets,const01,const02,const,var,obf, cmat, bvect,pra,minf,bds}, propsets = ProperCoalitions; const01 = Flatten[x[{#}] + Global`\[Alpha] >= v[#] & /@ propsets]; - const02 = MapThread[Equal, {{Apply[Plus, x[#] & /@ T]}, {v[T]}}]; + const02 = MapThread[Equal, {{Total[x[#] & /@ T]}, {v[T]}}]; const = FlattenAt[Append[const01, const02], Length[const01] + 1]; var = FlattenAt[{Global`\[Alpha], x /@ T}, 2]; {obf, cmat, bvect} = LPtoMatrix[Global`\[Alpha], const, var]; @@ -2212,12 +2303,86 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. -EssentialQ[game_]:=Module[{indrat,sumirat,zeroess}, +EssentialQ[game_]:=Block[{indrat,sumirat,zeroess}, indrat= v[{#}] &/@T; - sumirat = Apply[Plus,indrat]; + sumirat = Total[indrat]; zeroess = sumirat<=v[T] ]; +(* Formula of the Nucleolus for Three Person Games (cf. Leng and Parlar, 2010)*) + +NucleolusThreePerson[args___]:=(Message[NucleolusThreePerson::argerr];$Failed); +NucleolusThreePerson[game_] := + Block[{dmQ,cl2,ci,cdi,xd3,cd1,pcd1,ptk,cd4a,cd4b,cd4,pcd4,pcd4b,tk,tkl,tk2,ch,cd2,cd2a,cd2b,tc,cd3a,cd3b,cd3,ccik,pstrQ,cik,ext,sl1,sl2,rl1,rl2,rl3,its,cmp,pk,svl,cl}, + dmQ=SameQ[2^Length[T],2^3]; + If[dmQ,True,Print["Game has incorrect dimension!"];Return[]]; + cl2=Drop[Take[Subsets[T],-4],-1]; + ci=Cases[cl2,{___,#,___}] &/@ T; + cdi=DeleteCases[cl2,{___,#,___}] &/@ T; + xd3=First[(v[T] + #)/3] &/@ MapThread[Subtract[#1,#2] &,{Total[Map[v,#]] &/@ ci,2*Map[v,#] &/@ cdi}]; + (* Defining Cases *) + If[SameQ[CoreQ[game],False],Print["Case 0"];xd3, + cd1=GreaterEqual[v[T],3*v[#]] &/@ cl2; + pcd1=Position[cd1,False]; + ptk=Extract[cl2,pcd1]; + cd4a=Total[2*v[#]] &/@ DeleteCases[cl2,#] &/@ cl2; + cd4b=v[T]+v[#] &/@ cl2; + cd4=MapThread[GreaterEqual[#1,#2] &,{cd4b,Total[#] &/@ cd4a}]; + pcd4=Extract[cl2,Position[cd4,True]]; + tk2=Extract[cl2,Position[cd1,False]]; + tkl = Which[SameQ[tk2, {}], {}, + SameQ[pcd4, {}], {}, + True, First[Intersection[tk2, pcd4]]]; + ch=Cases[ci,{___,tkl,___}]; + tc=First[Complement[#,{tkl}]] &/@ ch; + cd2=MapThread[GreaterEqual[#1,#2] &,{{v[T]},#}] &/@ # &/@ (v[#] + 2*(v[#] &/@ DeleteCases[cl2,{___,#,___}] &/@ #) &/@ cl2); + cd2a=v[T] >= v[tkl] + 2*v[#] &/@ tc; + cd2b=Apply[Or,cd2a]; + cd3a=GreaterEqual[v[tkl],#] &/@ Map[v[#]&, tc]; + cd3b=Position[cd3a,True]; + cd3=SameQ[cd3b,{}]; + pstrQ=Position[Apply[Or,Flatten[#]] &/@ cd2,True]; + cik = If[SameQ[pstrQ, {}], First[DeleteCases[ci, {___, tkl, ___}]], Extract[ci, pstrQ] // First]; + (*Assigning Payoffs to the Players *) + Which[Apply[And,cd1], + Print["Case 1"];Array[v[T]/3 &,3], + SameQ[Apply[Or,cd1],True] && Apply[And, cd2a], + Print["Case 2"]; + ext=Extract[cl2,pcd1]; + sl1=(v[T] + v[#])/4 &/@ ext; + sl2=(v[T] - v[#])/2 &/@ ext; + rl1=MapThread[Rule,{{#},sl1}] &/@ Flatten[ext]; + rl2=MapThread[Rule,{Complement[T,Flatten[ext]],sl2}]; + T /. Flatten[AppendTo[rl1,rl2]], + SameQ[cd3,False] && SameQ[cd2b,True], + Print["Case 3"]; + ptk = If[Length[ptk] == 1, + If[Length[pcd4] == 1, + pcd4b = Extract[cl2, Position[cd4, False]]; + svl = v[#] & /@ pcd4b; + cl = First[Extract[pcd4b, Position[svl, Max[svl]]]]; + {cl, tkl} , pcd4], ptk]; + (* ptk = If[Length[ptk] == 1, pcd4, ptk]; *) + its=Apply[Intersection,ptk]; + rl1=MapThread[Rule,{its,{Total[v[#] &/@ ptk]/2}}]; + cmp=Complement[tkl,its]; + ccik=Complement[ptk,{tkl}]; + rl2=MapThread[Rule,{cmp,(v[T] - v[#])/2 &/@ ccik}]; + rl3=MapThread[Rule,{Complement[T,tkl],{(v[T] - v[tkl])/2}}]; + T /. Flatten[{rl1, rl2, rl3}], + Apply[Or,cd4] && SameQ[cd2b,False], + Print["Case 4"]; + pk=Complement[T,tkl]; + its=First[tkl] //List; + rl2 = MapThread[Rule,{its,{(v[T] + v[tkl] + 2*Apply[Subtract,v[#] &/@ tc])/4}}]; + cmp=Last[tkl] //List; + rl1 = MapThread[Rule,{cmp,{(v[T] + v[tkl] - 2*Apply[Subtract,v[#] &/@ tc])/4}}]; + rl3=MapThread[Rule,{pk,{(v[T] - v[tkl])/2}}]; + T /. Flatten[{rl1, rl2, rl3}], + True,Print["Case 5"];xd3 + ] + ] + ]; (* The next function translates the definition of the Nucleolus into @@ -2314,7 +2479,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. *) LSPreNuc[args___]:=(Message[LSPreNuc::argerr];$Failed); -LSPreNuc[game_]:=Module[{av,lt,pd,sS,Si,Sni,vi,vni,lci,lcni,pdi,pdni,sm1,sm2,sd1}, +LSPreNuc[game_]:=Block[{av,lt,pd,sS,Si,Sni,vi,vni,lci,lcni,pdi,pdni,sm1,sm2,sd1}, lt=Length[T]; av=v[T]/lt; pd=(1/(lt*2^(lt-2))); @@ -2333,7 +2498,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; LSNuc[args___]:=(Message[LSNuc::argerr];$Failed); -LSNuc[game_]:=Module[{lt,av,sV,sN,sS,Si,vi,lci,nV,py,ngQ,mM}, +LSNuc[game_]:=Block[{lt,av,sV,sN,sS,Si,vi,lci,nV,py,ngQ,mM}, lt=Length[T]; av=v[T]/lt; sN=2^(lt-2); @@ -2355,7 +2520,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -fLSnc[pyf_List,cmpM_List,stM_List,n_]:=Module[{M0,xm,lm,zv,cpM,pyM,tpy,cmpPy,rlcmp,rlp,py,pcM,ngQ,mM,nM,cM}, +fLSnc[pyf_List,cmpM_List,stM_List,n_]:=Block[{M0,xm,lm,zv,cpM,pyM,tpy,cmpPy,rlcmp,rlp,py,pcM,ngQ,mM,nM,cM}, M0=stM; py=If[SameQ[SameQ[cmp,{}],False], pyM=Extract[pyf,Partition[stM,1]]; @@ -2382,7 +2547,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. *) -FTPreNuc[game_,tol_:10^(-2),jj_:2]:=Module[{pk,vars,xpk,mcl,tol1,pmcl,clm,lcm,cex,rC,rexc,sme,mtr,smtr,slc,sC,lc,ls,sz}, +FTPreNuc[game_,tol_:10^(-2),jj_:2]:=Block[{pk,vars,xpk,mcl,tol1,pmcl,clm,lcm,cex,rC,rexc,sme,mtr,smtr,slc,sC,lc,ls,sz}, pk=PreKernel[game]; vars=x[#] &/@ T; pmcl=FTCoalArray[game,pk,tol]; @@ -2414,7 +2579,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -FormPreNuc[game_,tol_,jj_,iim_List,xvars_List]:=Module[{lsg}, +FormPreNuc[game_,tol_,jj_,iim_List,xvars_List]:=Block[{lsg}, lsg=Flatten[FindSolX[iim,xvars]]; If[SameQ[lsg,{}] && jj <11,FTPreNuc[game,tol,jj+1], If[SameQ[lsg,{}],Return[$Failed],xvars /. lsg]] @@ -2422,7 +2587,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. -FTCoalArray[game_,payoff_,tol_]:=Module[{sC,irQ,irc,slir,b0,I0,excpay,lI0,zv}, +FTCoalArray[game_,payoff_,tol_]:=Block[{sC,irQ,irc,slir,b0,I0,excpay,lI0,zv}, sC=Delete[Delete[Subsets[T],1],-1]; lt=Length[T]; excpay=Delete[Delete[Flatten[ExcessPayoff[game,payoff]],1],-1]; @@ -2431,7 +2596,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* We set the default of blQ to True in order to allow a return if mrk==lt on the first iteration.*) -PnSelectFTMCR[exc_List,sC_,lt_,tol_,pIk_:{},plIk_:{},pslex_:{},blQ_:True,mtrk_:0]:=Module[{mtr,smtr,slc,sS,lS,sC1,Im,bQ,mt,mrk,exc1,slex1,lIm1}, +PnSelectFTMCR[exc_List,sC_,lt_,tol_,pIk_:{},plIk_:{},pslex_:{},blQ_:True,mtrk_:0]:=Block[{mtr,smtr,slc,sS,lS,sC1,Im,bQ,mt,mrk,exc1,slex1,lIm1}, mtr=Abs[Subtract[#,Max[exc]]]<=tol &/@ exc; smtr=Position[mtr,True]; {slc,sS}=Extract[#,smtr] &/@ {exc,sC}; @@ -2470,7 +2635,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. *) -NonLinPreNuc[game_,p_,k_,tol_:10^(-2),jj_:2]:=Module[{sar,vars,xpk,mcl,tol1,pmcl,clm,lcm,cex}, +NonLinPreNuc[game_,p_,k_,tol_:10^(-2),jj_:2]:=Block[{sar,vars,xpk,mcl,tol1,pmcl,clm,lcm,cex}, sar=ApproxPreNuc[game,p,k]; vars=x[#] &/@ T; xpk=vars /. sar[[2]]; @@ -2495,14 +2660,14 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -FormatPreNuc[game_,p_,k_,tol_,jj_,iim_List,xvars_List]:=Module[{lsg}, +FormatPreNuc[game_,p_,k_,tol_,jj_,iim_List,xvars_List]:=Block[{lsg}, lsg=Flatten[FindSolX[iim,xvars]]; If[SameQ[lsg,{}] && jj <11,NonLinPreNuc[game,p,k,tol,jj+1], If[SameQ[lsg,{}],Return[$Failed],xvars /. lsg]] ]; -NonLinNuc[game_,p_,k_,tol_:10^(-2),jj_:2]:=Module[{sar,vars,xpk,mcl,tol1}, +NonLinNuc[game_,p_,k_,tol_:10^(-2),jj_:2]:=Block[{sar,vars,xpk,mcl,tol1}, sar=ApproxNuc[game,p,k]; vars=x[#] &/@ T; xpk=vars /. sar[[2]]; @@ -2512,27 +2677,27 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -FormatSol[game_,p_,k_,tol_,jj_,iim_List,xvars_List]:=Module[{lsg}, +FormatSol[game_,p_,k_,tol_,jj_,iim_List,xvars_List]:=Block[{lsg}, lsg=Flatten[FindSolX[iim,xvars]]; If[SameQ[lsg,{}] && jj <11,NonLinNuc[game,p,k,tol,jj+1], If[SameQ[lsg,{}],Return[$Failed],xvars /. lsg]] ]; -FormatPreNuc[game_,p_,k_,tol_,jj_,iim_List,xvars_List]:=Module[{lsg}, +FormatPreNuc[game_,p_,k_,tol_,jj_,iim_List,xvars_List]:=Block[{lsg}, lsg=Flatten[FindSolX[iim,xvars]]; If[SameQ[lsg,{}] && jj <11,NonLinPreNuc[game,p,k,tol,jj+1], If[SameQ[lsg,{}],Return[$Failed],xvars /. lsg]] ]; -FindSolX[ssz_List,vars_List]:=Module[{sys,eqsys}, +FindSolX[ssz_List,vars_List]:=Block[{sys,eqsys}, sys=(v[#]-x[#]) &/@ ssz[[1]]; eqsys=SolveSys[sys,ssz[[2]],ssz[[3]]]; If[NumberQ[eqsys],Return[{}],Solve[eqsys,vars]] ]; -SolveSys[bsys_List,iim_List,exc_List,glsys_:{},idx_:1]:=Module[{lg,gls,eq,zv,vexc,rsys,nwgl,riim,rexc}, +SolveSys[bsys_List,iim_List,exc_List,glsys_:{},idx_:1]:=Block[{lg,gls,eq,zv,vexc,rsys,nwgl,riim,rexc}, gls=Take[bsys,First[iim]]; lg=Length[gls]; If[exc=={} && lg==1,True,vexc=Take[exc,First[iim]]]; @@ -2556,22 +2721,22 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. -ApproxNuc[game_,p_,k_]:=Module[{lt,obj,const,rl,vars,sC,pexc,vi,eq}, +ApproxNuc[game_,p_,k_]:=Block[{lt,obj,const,rl,vars,sC,pexc,vi,eq}, vars = x[#] &/@ T; lt=Length[T]; sC=Delete[Subsets[T],1]; pexc=(v[#]-x[#]-k1)^p1 &/@ sC; rl=MapThread[Rule,{{p1,k1},{p,k}}]; - obj = Apply[Plus,pexc] /. rl; + obj = Total[pexc] /. rl; vi=v[#] &/@ Take[sC,lt]; const=Apply[And,MapThread[GreaterEqual,{vars,vi}]]; - eq=Apply[Plus,vars]==v[T]; + eq=Total[vars]==v[T]; AppendTo[const,eq]; NMinimize[obj,{const},vars] ]; ModCoalArray[args___]:=(Message[ModCoalArray::argerr];$Failed); -ModCoalArray[game_,payoff_,tol_:10^(-7)]:=Module[{sC,lt,prl,irQ,irc,slir,b0,I0,excpay,lI0,zv}, +ModCoalArray[game_,payoff_,tol_:10^(-7)]:=Block[{sC,lt,prl,irQ,irc,slir,b0,I0,excpay,lI0,zv}, sC=Delete[Delete[Subsets[T],1],-1]; lt=Length[T]; prl=Payoff[payoff]; @@ -2586,7 +2751,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. SelectMCR[excpay,sC,lt,tol,I0,{lI0},zv] ]; -PnModCoalArray[game_,payoff_,tol_]:=Module[{sC,lt,excpay}, +PnModCoalArray[game_,payoff_,tol_]:=Block[{sC,lt,excpay}, sC=Delete[Delete[Subsets[T],1],-1]; lt=Length[T]; excpay=Delete[Delete[Flatten[ExcessPayoff[game,payoff]],1],-1]; @@ -2594,7 +2759,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -SelectMCR[exc_List,sC_,lt_,tol_,Ik_:{},lIk_:{},slex_:{0},blQ_:False,mtrk_:0]:=Module[{mtr,smtr,slc,sS,lS,sC1,Im,mrk,bQ,mt,mkr,exc1,slex1,lIm1}, +SelectMCR[exc_List,sC_,lt_,tol_,Ik_:{},lIk_:{},slex_:{0},blQ_:False,mtrk_:0]:=Block[{mtr,smtr,slc,sS,lS,sC1,Im,mrk,bQ,mt,mkr,exc1,slex1,lIm1}, mtr=Abs[Subtract[#,Max[exc]]]<=tol &/@ exc; smtr=Position[mtr,True]; slc=Extract[exc,smtr]; @@ -2623,7 +2788,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ] ]; -PnSelectMCR[exc_List,sC_,lt_,tol_,pIk_:{},plIk_:{},pslex_:{},blQ_:False,mtrk_:0]:=Module[{mtr,smtr,slc,sS,lS,sC1,mrk,Im,bQ,mt,mkr,exc1,slex1,lIm1}, +PnSelectMCR[exc_List,sC_,lt_,tol_,pIk_:{},plIk_:{},pslex_:{},blQ_:False,mtrk_:0]:=Block[{mtr,smtr,slc,sS,lS,sC1,mrk,Im,bQ,mt,mkr,exc1,slex1,lIm1}, mtr=Abs[Subtract[#,Max[exc]]]<=tol &/@ exc; smtr=Position[mtr,True]; slc=Extract[exc,smtr]; @@ -2655,7 +2820,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. IIMBalancedSelectionQ[selcoal_List, tol_,opts:OptionsPattern[BalancedSelectionQ]]:= - Module[{tig,ufs,sysvec,lt,tol1,wghvec1,tolv,mrk,onesvec,wghvec,chres,poswghQ,posQ,addoneQ,oneQ,balcQ}, + Block[{tig,ufs,sysvec,lt,tol1,wghvec1,tolv,mrk,onesvec,wghvec,chres,poswghQ,posQ,addoneQ,oneQ,balcQ}, tig = OptionValue[Tight]; ufs=Union[Flatten[selcoal]]; If[SameQ[ufs,T],True,Return["False"]]; @@ -2688,17 +2853,17 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. -ApproxPreNuc[game_,p_,k_]:=Module[{obj,const,lt,ra,rl,vars,sC,pexc,vi,eq}, +ApproxPreNuc[game_,p_,k_]:=Block[{obj,const,lt,ra,rl,vars,sC,pexc,vi,eq}, vars = x[#] &/@ T; lt=Length[T]; sC=Delete[Subsets[T],1]; pexc=(v[#]-x[#]-k1)^p1 &/@ sC; rl=MapThread[Rule,{{p1,k1},{p,k}}]; - obj = Apply[Plus,pexc] /. rl; + obj = Total[pexc] /. rl; ra=ReasonableOutcome[game]; const=Apply[And,MapThread[LessEqual,{vars,ra}]]; (* Print["const=",const]; *) - eq=Apply[Plus,vars]==v[T]; + eq=Total[vars]==v[T]; AppendTo[const,eq]; NMinimize[obj,{const},vars] ]; @@ -2711,7 +2876,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. onto the player set T gives the modiclus of the original game. *) Modiclus[args___]:=(Message[Modiclus::argerr];$Failed); -Modiclus[game_] := Module[{ovls, dcvals, lt, t0, t1, DCGame, mdnc}, +Modiclus[game_] := Block[{ovls, dcvals, lt, t0, t1, DCGame, mdnc}, ovls = v[#] & /@ Coalitions; (* Storing original game values. *) t0 = T; (* Storing original game values. *) dcvals = DualCover[game]; @@ -2725,7 +2890,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. IsModiclusQ[args___]:=(Message[IsModiclusQ::argerr];$Failed); -IsModiclusQ[game_,payoff_List] := Module[{ovls, dcvals, lt, t0, t1, dpay, DCGame, bcQ}, +IsModiclusQ[game_,payoff_List] := Block[{ovls, dcvals, lt, t0, t1, dpay, DCGame, bcQ}, ovls = v[#] & /@ Coalitions; (* Storing original game values. *) t0 = T; (* Storing original game values. *) dcvals = DualCover[game]; @@ -2741,12 +2906,12 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ModPreKernel[args___]:=(Message[ModPreKernel::argerr];$Failed); ModPreKernel[game_,opts:OptionsPattern[ModPreKernel]] := - Module[{pay}, + Block[{pay}, pay = Table[v[T],{Length[T]}]/Length[T]; ModPreKernel[game,pay,opts] ]; -ModPreKernel[game_, payoff_List, opts:OptionsPattern[ModPreKernel]] := Module[{dimpay,rclim}, +ModPreKernel[game_, payoff_List, opts:OptionsPattern[ModPreKernel]] := Block[{dimpay,rclim}, dimpay = Dimensions[payoff]; rclim=If[Length[T] > 11,1024,512]; Which[Length[dimpay]===2, @@ -2762,7 +2927,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* Main Functions *) FuncModPreKernel[game_, payoff_List, opts:OptionsPattern[ModPreKernel]] := -Module[{sil, smc, optst, pinv, ovls, t0, dcvals, dcgame, doi, optstep, itpay,tol,brc}, +Block[{sil, smc, optst, pinv, ovls, t0, dcvals, dcgame, doi, optstep, itpay,tol,brc}, sil = OptionValue[Silent]; smc = OptionValue[SmallestCardinality]; optst = OptionValue[CalcStepSize]; @@ -2784,7 +2949,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; ProperModPreKernel[args___]:=(Message[ProperModPreKernel::argerr];$Failed); -ProperModPreKernel[game_,opts:OptionsPattern[ProperModPreKernel]] := Module[{ovls, dcvals, lt, t0, t1, DCGame, mdnc}, +ProperModPreKernel[game_,opts:OptionsPattern[ProperModPreKernel]] := Block[{ovls, dcvals, lt, t0, t1, DCGame, mdnc}, ovls = v[#] & /@ Coalitions; (* Storing original game values. *) t0 = T; (* Storing original game values. *) dcvals = DualCover[game]; @@ -2797,7 +2962,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -ProperModPreKernel[game_,payoff_List,opts:OptionsPattern[ProperModPreKernel]] := Module[{ovls, dcvals, lt, t0, t1, DCGame, mdnc,dcpay}, +ProperModPreKernel[game_,payoff_List,opts:OptionsPattern[ProperModPreKernel]] := Block[{ovls, dcvals, lt, t0, t1, DCGame, mdnc,dcpay}, ovls = v[#] & /@ Coalitions; (* Storing original game values. *) t0 = T; (* Storing original game values. *) dcvals = DualCover[game]; @@ -2813,7 +2978,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. IsModPreKernelQ[args___]:=(Message[IsModPreKernelQ::argerr];$Failed); IsModPreKernelQ[game_, payoff_List] := - Module[{ovls, dcvals, lt, t0, t1, DCGame, pmpkQ}, + Block[{ovls, dcvals, lt, t0, t1, DCGame, pmpkQ}, ovls = v[#] & /@ Coalitions;(*Storing original game values.*) t0 = T;(*Storing original game values.*) dcvals = ECCoverGame[game, payoff]; @@ -2824,7 +2989,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. IsProperModPreKernelQ[args___]:=(Message[IsProperModPreKernelQ::argerr];$Failed); -IsProperModPreKernelQ[game_,payoff_List] := Module[{ovls, dcvals, lt, t0, t1, dpay, DCGame, pmpkQ}, +IsProperModPreKernelQ[game_,payoff_List] := Block[{ovls, dcvals, lt, t0, t1, dpay, DCGame, pmpkQ}, ovls = v[#] & /@ Coalitions; (* Storing original game values. *) t0 = T; (* Storing original game values. *) dcvals = DualCover[game]; @@ -2840,7 +3005,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* Dual Extension of the primal game *) DualExtension[args___]:=(Message[DualExtension::argerr];$Failed); -DualExtension[game_] := Module[{lt, T1, cl1, clset, vlset, dlext,vals}, +DualExtension[game_] := Block[{lt, T1, cl1, clset, vlset, dlext,vals}, lt = Length[T]; T1 = Range[lt + 1, 2*lt]; cl1 = Subsets[T1]; @@ -2855,7 +3020,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* Primal Extension of the dual game *) PrimalExtension[args___]:=(Message[PrimalExtension::argerr];$Failed); PrimalExtension[game_] := - Module[{lt, T1, cl1, clset, vlset, plext,vals}, + Block[{lt, T1, cl1, clset, vlset, plext,vals}, lt = Length[T]; T1 = Range[lt + 1, 2*lt]; cl1 = Subsets[T1]; @@ -2867,7 +3032,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; DualCover[args___]:=(Message[DualCover::argerr];$Failed); -DualCover[game_] := Module[{dvals, dexts, pvals, pexts}, +DualCover[game_] := Block[{dvals, dexts, pvals, pexts}, {dvals, dexts} = DualExtension[game]; {pvals, pexts} = PrimalExtension[game]; MapThread[Max[#1, #2] &, {dvals, pvals}] @@ -2876,7 +3041,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ModECCoverGame[game_, payoff_] := - Module[{exc, mexc, dv, sx, df, assg, dmexc, pvals, dvals, vals}, + Block[{exc, mexc, dv, sx, df, assg, dmexc, pvals, dvals, vals}, exc = ExcessPayoff[game, payoff]; mexc = Max[exc]; dv = (v[T] - v[#]) & /@ Reverse[Coalitions]; @@ -2893,7 +3058,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ECCoverGame[args___]:=(Message[ECCoverGame::argerr];$Failed); ECCoverGame[game_, payoff_] := - Module[{exc, mexc, dv, sx, df, assg, dmexc, pvals, dvals, vals}, + Block[{exc, mexc, dv, sx, df, assg, dmexc, pvals, dvals, vals}, exc = ExcessPayoff[game, payoff]; mexc = Max[exc]; dv = (v[T] - v[#]) & /@ Reverse[Coalitions]; @@ -2914,7 +3079,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* Start of the section related to the simplified modified pre-kernel/nucleolus of a game. *) SMPreKernel[args___]:=(Message[SMPreKernel::argerr];$Failed); -SMPreKernel[game_] := Module[{ovls, dv, av, AVGame, smpk}, +SMPreKernel[game_] := Block[{ovls, dv, av, AVGame, smpk}, ovls = v[#] & /@ Coalitions;(*Storing original game values.*) dv = DualGame[game]; av = (ovls + dv)/2; @@ -2925,7 +3090,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; IsSMPreKernelQ[args___]:=(Message[IsSMPreKernelQ::argerr];$Failed); -IsSMPreKernelQ[game_, payoff_] := Module[{ovls, dv, av, AVGame, smpkQ}, +IsSMPreKernelQ[game_, payoff_] := Block[{ovls, dv, av, AVGame, smpkQ}, ovls = v[#] & /@ Coalitions;(*Storing original game values.*) dv = DualGame[game]; av = (ovls + dv)/2; @@ -2936,7 +3101,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; SMPrenucleolus[args___]:=(Message[SMPrenucleolus::argerr];$Failed); -SMPrenucleolus[game_] := Module[{ovls, dv, av, AVGame, smpn}, +SMPrenucleolus[game_] := Block[{ovls, dv, av, AVGame, smpn}, ovls = v[#] & /@ Coalitions;(*Storing original game values.*) dv = DualGame[game]; av = (ovls + dv)/2; @@ -2948,7 +3113,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. IsSMPrenucleolusQ[args___]:=(Message[IsSMPrenulceolusQ::argerr];$Failed); IsSMPrenucleolusQ[game_, payoff_] := - Module[{ovls, dv, av, AVGame, smpnQ}, + Block[{ovls, dv, av, AVGame, smpnQ}, ovls = v[#] & /@ Coalitions;(*Storing original game values.*) dv = DualGame[game]; av = (ovls + dv)/2; @@ -2973,7 +3138,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. BalancedSelectionQ[args___]:=(Message[BalancedSelectionQ::argerr];$Failed); -BalancedSelectionQ[game_, payoff_List, opts:OptionsPattern[BalancedSelectionQ]]:=Module[{dimpay,cc}, +BalancedSelectionQ[game_, payoff_List, opts:OptionsPattern[BalancedSelectionQ]]:=Block[{dimpay,cc}, dimpay = Dimensions[payoff]; Which[Length[dimpay]===2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3) , @@ -2989,7 +3154,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. BalancedSelectionQ[selcoal_List, opts:OptionsPattern[BalancedSelectionQ]]:= - Module[{dispres,tig,ufs,sysvec,mrk,onesvec,wghvec,chres,poswghQ,posQ,addoneQ,oneQ,balcQ}, + Block[{dispres,tig,ufs,sysvec,mrk,onesvec,wghvec,chres,poswghQ,posQ,addoneQ,oneQ,balcQ}, dispres = OptionValue[DisplayAllResults]; tig = OptionValue[Tight]; ufs=Union[Flatten[selcoal]]; @@ -3015,7 +3180,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. BalancedSelectionQ[selcoal_List, tol_, opts:OptionsPattern[BalancedSelectionQ]]:= - Module[{dispres,tig,ufs,sysvec,mrk,lt,onesvec,wghvec,chres,tol1,wghvec1,tolv,wghs,smat,poswghQ,posQ,addoneQ,oneQ,balcQ}, + Block[{dispres,tig,ufs,sysvec,mrk,lt,onesvec,wghvec,chres,tol1,wghvec1,tolv,wghs,smat,poswghQ,posQ,addoneQ,oneQ,balcQ}, dispres = OptionValue[DisplayAllResults]; tig = OptionValue[Tight]; ufs=Union[Flatten[selcoal]]; @@ -3051,7 +3216,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. BalancedSelctQ[game_, payoff_List, opts:OptionsPattern[BalancedSelectionQ]] := - Module[{dispres,sil,tig,selc,ufs,lt,sysvec,onesvec,balcmat,mrk,wghs,fpQ,mbQ,nmbQ,rQ,flr,tk,extb,slc,smat,wghvec,chres,numch,btkm,posQ,newwghs,addoneQ,oneQ,balcQ}, + Block[{dispres,sil,tig,selc,ufs,lt,sysvec,onesvec,balcmat,mrk,wghs,fpQ,mbQ,nmbQ,rQ,flr,tk,extb,slc,smat,wghvec,chres,numch,btkm,posQ,newwghs,addoneQ,oneQ,balcQ}, dispres = OptionValue[DisplayAllResults]; sil = OptionValue[Silent]; tig = OptionValue[Tight]; @@ -3120,7 +3285,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -NewWghs[mat_List,wghs_List] := Module[{poswghsQ,posQ, newwghs }, +NewWghs[mat_List,wghs_List] := Block[{poswghsQ,posQ, newwghs }, poswghsQ = Positive[#] &/@ wghs; posQ = Apply[And,poswghsQ]; If[SameQ[posQ,False], newwghs = DetPosWeights[mat,wghs], newwghs = wghs]; @@ -3129,7 +3294,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. If[SameQ[posQ,False], NormMinimize[mat,wghs], newwghs] (* Floating Point Exception Ver. 7.x *) ]; -NormMinimize[mat_List, wghs_List]:=Module[{onesvec,zerolist,avars,constset,objfu,objsys,resmin,gw}, +NormMinimize[mat_List, wghs_List]:=Block[{onesvec,zerolist,avars,constset,objfu,objsys,resmin,gw}, onesvec = Table[1, {i, Length[T]}]; zerolist = Table[0, {i, Length[mat]}]; avars = Table[a[i], {i, Length[mat]}]; @@ -3145,9 +3310,9 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. -DetPosWeights[mat_List, wghs_List]:=Module[{nlsp,nlvec,nwghs01,nwghs02,negQ}, +DetPosWeights[mat_List, wghs_List]:=Block[{nlsp,nlvec,nwghs01,nwghs02,negQ}, nlsp = NullSpace[Transpose[mat]]; - nlvec = Apply[Plus, nlsp]; + nlvec = Total[nlsp]; nwghs01 = wghs + (1/100) * nlvec; nwghs02 = wghs - (1/25) * nlvec; negQ = Apply[And, Positive[#] ] &/@ {nwghs01,nwghs02}; @@ -3158,7 +3323,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; WeaklyBalancedSelectionQ[args___]:=(Message[WeaklyBalancedSelectionQ::argerr];$Failed); -WeaklyBalancedSelectionQ[game_, payoff_List, opts:OptionsPattern[WeaklyBalancedSelectionQ]]:=Module[{dimpay}, +WeaklyBalancedSelectionQ[game_, payoff_List, opts:OptionsPattern[WeaklyBalancedSelectionQ]]:=Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay]===2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3) , WeakBalancedSelctQ[game,#, opts]&/@ payoff, @@ -3173,7 +3338,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. WeakBalancedSelctQ[game_, payoff_List, opts:OptionsPattern[WeaklyBalancedSelectionQ]] := - Module[{dispres,selc,ufs,lt,sysvec,onesvec,balcmat,mrk,sil,flr,trQ,wghvec,chres,numch,poswghQ,posQ,newwghs,addoneQ,oneQ,balcQ}, + Block[{dispres,selc,ufs,lt,sysvec,onesvec,balcmat,mrk,sil,flr,trQ,wghvec,chres,numch,poswghQ,posQ,newwghs,addoneQ,oneQ,balcQ}, dispres = OptionValue[DisplayAllResults]; sil = OptionValue[Silent]; selc = BalancedCollect[game, payoff]; @@ -3209,7 +3374,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -NewWeakWghs[mat_List,wghs_List] := Module[{poswghsQ,posQ, newwghs }, +NewWeakWghs[mat_List,wghs_List] := Block[{poswghsQ,posQ, newwghs }, poswghsQ = NonNegative[#] &/@ wghs; posQ = Apply[And,poswghsQ]; If[SameQ[posQ,False], newwghs = DetPosWeights[mat,wghs], newwghs = wghs]; @@ -3218,7 +3383,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. If[SameQ[posQ,False], WeakNormMinimize[mat,wghs], newwghs] (* Floating Point Exception Ver. 7.x *) ]; -WeakNormMinimize[mat_List, wghs_List]:=Module[{onesvec,zerolist,avars,constset,objfu,objsys,resmin,gw}, +WeakNormMinimize[mat_List, wghs_List]:=Block[{onesvec,zerolist,avars,constset,objfu,objsys,resmin,gw}, onesvec = Table[1, {i, Length[T]}]; zerolist = Table[0, {i, Length[mat]}]; avars = Table[a[i], {i, Length[mat]}]; @@ -3235,17 +3400,17 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. CollectionOfDecreasingExcess[args___]:=(Message[CollectionOfDecreasingExcess::argerr];$Failed); CollectionOfDecreasingExcess[game_,payoff_List]:=BalancedCollect[game,payoff]; -BalancedCollect[game_, payoff_List] := Module[{levexc, redlev}, +BalancedCollect[game_, payoff_List] := Block[{levexc, redlev}, levexc = Drop[Drop[ExcessPayoff[game, payoff][[1]],-1],1]; redlev = Reverse[Union[Sort[levexc]]]; Table[DeleteCases[DetBalancedCollec[#, payoff, redlev[[i]]] & /@ Drop[Drop[Subsets[T], -1],1], {}], {i, Length[redlev]}] ]; -DetBalancedCollec[S_List, payoff_List, \[Alpha]_] := Module[{}, +DetBalancedCollec[S_List, payoff_List, \[Alpha]_] := Block[{}, If[GreaterEqual[Excess[payoff, S], \[Alpha]], S, {}] ]; -ConstVec[meff_List] := Module[{zrv, onesvec, pscoal}, +ConstVec[meff_List] := Block[{zrv, onesvec, pscoal}, zrv = Table[0, {i, Length[T]}]; pscoal = Outer[List, #] & /@ meff; ReplacePart[zrv, 1, #] & /@ pscoal @@ -3258,7 +3423,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. kBalancednessQ[args___]:=(Message[kBalancednessQ::argerr];$Failed); kBalancednessQ[selcoal_List, KC_List, opts:OptionsPattern[kBalancednessQ]]:= - Module[{dispres,sysvec,mrk,trQ,vecps,zrv,onesvec,wghvec,chres,poswghQ,posQ,addoneQ,oneQ,balcQ}, + Block[{dispres,sysvec,mrk,trQ,vecps,zrv,onesvec,wghvec,chres,poswghQ,posQ,addoneQ,oneQ,balcQ}, dispres = OptionValue[DisplayAllResults]; sysvec = ConstVec[selcoal]; mrk=MatrixRank[sysvec]; @@ -3281,7 +3446,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; -ReduceMatrix[wghs_List,mat_List,KC_List,onesv_List]:=Module[{lkc,adv,zrv,nwm}, +ReduceMatrix[wghs_List,mat_List,KC_List,onesv_List]:=Block[{lkc,adv,zrv,nwm}, lkc = Length[KC]; adv=If[Positive[#],1,0] & /@ wghs; nwm=adv*mat; @@ -3292,7 +3457,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ReduceRkMatrix[wghs_List,mat_List,KC_List,onesv_List]:= - Module[{lkc,adv,ctz,zrv,psz,pso,tk,nwm,nwm1,nwm2,swgh}, + Block[{lkc,adv,ctz,zrv,psz,pso,tk,nwm,nwm1,nwm2,swgh}, lkc = Length[KC]; adv = If[Positive[#],1,0] & /@ wghs; ctz = Count[adv,0]; @@ -3320,7 +3485,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* User interface for payoff vectors. *) -SelectionKBalancedQ[game_, payoff_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]]:=Module[{dispres, verb, dimpay, selc,binval,cc}, +SelectionKBalancedQ[game_, payoff_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]]:=Block[{dispres, verb, dimpay, selc,binval,cc}, dispres = OptionValue[DisplayAllResults]; verb = OptionValue[Silent]; dimpay = Dimensions[payoff]; @@ -3346,7 +3511,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. -CheckCoalStructure[selcoal_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]] := Module[{verb, cst}, +CheckCoalStructure[selcoal_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]] := Block[{verb, cst}, verb = OptionValue[Silent]; If[verb === False, Print["selcoal=", selcoal ];, True ]; Which[Depth[selcoal] === 3, @@ -3367,7 +3532,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. (* User interface for coalition structures. *) -SelectionKBalancedQ[selcoal_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]] := Module[{}, +SelectionKBalancedQ[selcoal_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]] := Block[{}, Which[Depth[selcoal] === 3, Which[GreaterEqual[k, Length[T]] === True, BalancedSelectionQ[selcoal, opts], GreaterEqual[k, 2] === True, SelctKBalacQ[selcoal, k, opts], @@ -3382,7 +3547,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. SelctKBalacQ[selcoal_List, k_Integer, opts:OptionsPattern[SelectionKBalancedQ]] := - Module[{verb,dispres,onesvec,eqtok,ufs,bveq,kcoll,kbalsel,kbalmat,mrk,flr,trQ,kwghs,selkbalQ,redw,nkwghs,nkbalmat,kpos,kselall, + Block[{verb,dispres,onesvec,eqtok,ufs,bveq,kcoll,kbalsel,kbalmat,mrk,flr,trQ,kwghs,selkbalQ,redw,nkwghs,nkbalmat,kpos,kselall, kbalQ, kinprd, ksum, ksumeqQ, ksQ}, dispres = OptionValue[DisplayAllResults]; verb = OptionValue[Silent]; @@ -3418,14 +3583,14 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. If[SameQ[dispres,True], {selkbalQ, nkwghs, nkbalmat, kbalsel}, selkbalQ] ]; -ComputeWeights[kmatrix_List, onesv_List, k_Integer] := Module[{trkmat, d1, d2}, +ComputeWeights[kmatrix_List, onesv_List, k_Integer] := Block[{trkmat, d1, d2}, trkmat = Transpose[kmatrix]; {d1,d2} = Dimensions[trkmat]; If[SameQ[{d1 ,d2},{k, k}], Inverse[trkmat].onesv, WghsPseudoInvers[trkmat, onesv] ] ]; -WghsPseudoInvers[kmatrix_List, onesv_List] := Module[{psmat, wghs, psQ, trQ}, +WghsPseudoInvers[kmatrix_List, onesv_List] := Block[{psmat, wghs, psQ, trQ}, psmat = PseudoInverse[kmatrix]; wghs = psmat.onesv; psQ = Positive[#] &/@ wghs; @@ -3433,9 +3598,9 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. If[SameQ[trQ,True], wghs , DetPositiveWeights[psmat, wghs]] ]; -DetPositiveWeights[kmatrix_List, wghs_List]:=Module[{nlsp,nlvec,nwghs01,nwghs02,negQ}, +DetPositiveWeights[kmatrix_List, wghs_List]:=Block[{nlsp,nlvec,nwghs01,nwghs02,negQ}, nlsp = NullSpace[Transpose[kmatrix]]; - nlvec = Apply[Plus, nlsp]; + nlvec = Total[nlsp]; nwghs01 = wghs + (1/100) * nlvec; nwghs02 = wghs - (1/100) * nlvec; negQ = Apply[And, Positive[#] ] &/@ {nwghs01,nwghs02}; @@ -3452,7 +3617,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. BalancedCollectionQ[args___] := (Message[BalancedCollectionQ::argerr]; $Failed); BalancedCollectionQ[game_, payoff_List, opts : OptionsPattern[BalancedCollectionQ]] := - Module[{dimpay, cc}, dimpay = Dimensions[payoff]; + Block[{dimpay, cc}, dimpay = Dimensions[payoff]; Which[Length[dimpay] === 2, Which[(Last[dimpay] === Length[T] && Depth[payoff] === 3), cc = BalancedCollMainQ[game, #, opts] & /@ payoff; Simplify[cc], @@ -3465,7 +3630,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. BalancedCollMainQ[game_, payoff_] := - Module[{cde, acde, rkQ, tk, lprs}, + Block[{cde, acde, rkQ, tk, lprs}, cde = CollectionOfDecreasingExcess[game, payoff]; AppendTo[cde, {}]; acde = FlattenAt[Append[{#}, T], 1] & /@ cde; @@ -3475,7 +3640,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. Apply[And, lprs]]; -RankConQ[coll_List, T_List] := Module[{zvec, ovec, pos, mat, rk}, +RankConQ[coll_List, T_List] := Block[{zvec, ovec, pos, mat, rk}, zvec = Array[0 &, Length[T]]; ovec = Array[1 &, Length[T]]; pos = Outer[List, #] & /@ coll; @@ -3498,7 +3663,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. Scrb[args___]:=(Message[Scrb::argerr];$Failed); -Scrb[game_, i_Integer]:= UpperPayoff[game,i] + (1/Length[T]) (v[T] - Apply[Plus,UpperVector[game]]); +Scrb[game_, i_Integer]:= UpperPayoff[game,i] + (1/Length[T]) (v[T] - Total[UpperVector[game]]); ScrbSolution[args___]:=(Message[ScrbSolution::argerr];$Failed); ScrbSolution[game_]:= (Scrb[game,#] & ) /@ T; @@ -3508,7 +3673,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. FindPreKernelSolution[args___]:=(Message[FindPreKernelSolution::argerr];$Failed); FindPreKernelSolution[game_,opts:OptionsPattern[FindPreKernelSolution]] := - Module[{pay}, + Block[{pay}, pay = Table[v[T],{Length[T]}]/Length[T]; FindPreKernelSolution[game,pay,opts] ]; @@ -3516,7 +3681,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. FindPreKernelSolution[game_, payoff_List, opts:OptionsPattern[FindPreKernelSolution]]:= -Module[{prec,rattol,reclim,setprk,sil,res}, +Block[{prec,rattol,reclim,setprk,sil,res}, Off[$RecursionLimit::reclim]; (*Swichting off all warnings that reclim is exceeded *) Off[General::stop]; Off[MapThread::mptd]; @@ -3558,14 +3723,14 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. FindKernelSolution[args___]:=(Message[FindKernelSolution::argerr];$Failed); FindKernelSolution[game_,opts:OptionsPattern[FindKernelSolution]] := - Module[{pay}, + Block[{pay}, pay = Table[v[T],{Length[T]}]/Length[T]; FindKernelSolution[game,pay,opts] ]; FindKernelSolution[game_, payoff_List, opts:OptionsPattern[FindKernelSolution]]:= -Module[{prec,rattol,reclim,setker,sil,res}, +Block[{prec,rattol,reclim,setker,sil,res}, Off[$RecursionLimit::reclim]; (*Swichting off all warnings that reclim is exceeded *) Off[General::stop]; Off[MapThread::mptd]; @@ -3606,7 +3771,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ] ]; -SolutionSelection[game_,payoff_List]:= Module[{bool,pos,lsg}, +SolutionSelection[game_,payoff_List]:= Block[{bool,pos,lsg}, bool = KernelImputationListQ[game,payoff]; pos = Position[bool,True]; lsg = If[Length[pos]===0,payoff,Extract[payoff,pos]]; @@ -3614,7 +3779,7 @@ A game v is monotone if v(S \cup i) - v(S) is non-negative for all i \in N. ]; KernelSolution[game_, payoff_List, prec_,rattol_,setk_,silent_,payold_:{}] := -Module[{payvec, pold=payold,approx,ratnum}, +Block[{payvec, pold=payold,approx,ratnum}, payvec = If[SameQ[Global`PRK,setk],ConvergenceToKernel[game, payoff],ConvergenceToKernel2[game, payoff]]; pold = payoff; approx = N[payvec, prec]; @@ -3705,13 +3870,13 @@ of Meinhardt (2013) DeltaLP[args___]:=(Message[DeltaLP::argerr];$Failed); DeltaLP[game_, i_Integer, j_Integer, eps_:0, ops:OptionsPattern[DeltaLP]] := - Module[{changesolver}, + Block[{changesolver}, changesolver=OptionValue[CallMaximize]; DeltaLP[game, i, j, eps,changesolver] ]; DeltaLP[game_, i_Integer, j_Integer, eps_:0, changesolver_:False] := - Module[{}, + Block[{}, Which[changesolver==False, ConstrainedMax[Global`\[Delta], Union[TransferConstraints[game, i, j, eps]], Join[x /@ T, {Global`\[Delta]}]], True, @@ -3725,13 +3890,13 @@ of Meinhardt (2013) Transfer[args___]:=(Message[Transfer::argerr];$Failed); Transfer[y_List, T_List, d_, i_Integer, j_Integer] := - Module[{idmat}, + Block[{idmat}, idmat = IdentityMatrix[Length[T]]; (x /@ T /. Payoff[y]) - d Extract[idmat, i] + d Extract[idmat, j] ]; MaxDeltaij[game_, eps_:0,changesolver_] := - Module[{anf = T, rest, pi, pj, erg = {}}, + Block[{anf = T, rest, pi, pj, erg = {}}, While[Length[anf] > 1, pi = First[anf]; rest = Drop[anf, 1]; @@ -3744,7 +3909,7 @@ of Meinhardt (2013) Return[erg]]; TijLoop[game_] := - Module[{anf = T, rest, pi, pj, menge = {}}, + Block[{anf = T, rest, pi, pj, menge = {}}, While[Length[anf] > 1, pi = First[anf]; rest = Drop[anf, 1]; @@ -3763,7 +3928,7 @@ of Meinhardt (2013) lhs <= rhs + param[[i]] /; rhs == Min[liste]}, {i, Length[param]}]; SortConstraints[ineq_, para_] := - Module[{pospattern, rg,extpos}, + Block[{pospattern, rg,extpos}, pospattern = Position[ineq, Cases[ineq, _. + para, {2}][[1]], {2}]; rg=Range[Length[pospattern]]; extpos = Outer[List, pospattern[[#, 1]] & /@ rg]; @@ -3771,7 +3936,7 @@ of Meinhardt (2013) FeasibleConstraints[ineq_, delta_,changesolver_] := - Module[{newungl,delexc = Sort[delta], creatpara, redpara, paramet, nebenbed, zf, fineq, feasbineq = {}, allineq, varb, sol, resl, setofineq}, + Block[{newungl,delexc = Sort[delta], creatpara, redpara, paramet, nebenbed, zf, fineq, feasbineq = {}, allineq, varb, sol, resl, setofineq}, newungl = Drop[ineq, -1]; creatpara = Array[a[#] &,{Length[delexc],Length[newungl]}]; redpara = Union[Flatten[creatpara]]; @@ -3785,7 +3950,7 @@ of Meinhardt (2013) ]; allineq = Rationalize[Flatten[Append[feasbineq, Last[ineq]]],0.01]; varb = Append[x /@ T, redpara] // Flatten; - zf = Apply[Plus, redpara]; + zf = Total[redpara]; sol = Which[changesolver == False, ConstrainedMin[zf, allineq, varb], True, Rationalize[NMinimize[Prepend[allineq,zf], varb]]]; resl = x /@ T /. sol[[2]]; @@ -3797,7 +3962,7 @@ of Meinhardt (2013) NewConstraints[sets_, constraints_, del_, eps_:0] := - Module[{Tijsys, delta, dij = del, mengsys = sets, exccon, const = constraints}, + Block[{Tijsys, delta, dij = del, mengsys = sets, exccon, const = constraints}, While[Length[dij] > 0, delta = Take[dij, 1][[1]]; Tijsys = Take[mengsys, 1]; @@ -3811,12 +3976,12 @@ of Meinhardt (2013) (* Auxiliary functions to verify balancedness of the excess vector *) -CheckBalancedness[game_, pay_] := Module[{ balancedQ}, +CheckBalancedness[game_, pay_] := Block[{ balancedQ}, balancedQ = MaxExcessBalanced[newgame, pay][[1]] ]; -AssgPay[payoff_List] := Module[{vars}, +AssgPay[payoff_List] := Block[{vars}, vars = x[#] & /@ T; MapThread[Rule, {vars, payoff}] ]; @@ -3834,7 +3999,7 @@ of Meinhardt (2013) MaxSurplus[args___]:=(Message[MaxSurplus::argerr];$Failed); MaxSurplus[game_, pi_, pj_, payoff_List] := - Module[{payass}, + Block[{payass}, payass = Which[Depth[payoff]==3, MapThread[Rule,{x /@ T,#}]& /@ payoff, Depth[payoff]==2, MapThread[Rule,{x /@ T,payoff}], True, Print["The input 'payoff' is not a list."];Return[]]; @@ -3845,7 +4010,7 @@ of Meinhardt (2013) AntiSurplus[game_, pi_, pj_, payoff_List] := - Module[{payass}, + Block[{payass}, payass = Which[Depth[payoff]==3, MapThread[Rule,{x /@ T,#}]& /@ payoff, Depth[payoff]==2, MapThread[Rule,{x /@ T,payoff}], True, Print["The input 'payoff' is not a list."];Return[]]; @@ -3857,7 +4022,7 @@ of Meinhardt (2013) MaxSurpluses[game_, payoff_List] := - Module[{dir,pli,plj,maxpi,maxpj,res}, + Block[{dir,pli,plj,maxpi,maxpj,res}, dir = Partition[listIJ[T],2]; pli = First[#] &/@ dir; plj = #[[2]] &/@ dir; @@ -3867,7 +4032,7 @@ of Meinhardt (2013) ]; AntiSurpluses[game_, payoff_List] := - Module[{dir,pli,plj,minpi,minpj,res}, + Block[{dir,pli,plj,minpi,minpj,res}, dir = Partition[listIJ[T],2]; pli = First[#] &/@ dir; plj = #[[2]] &/@ dir; @@ -3878,7 +4043,7 @@ of Meinhardt (2013) AllMaxSurpluses[args___]:=(Message[AllMaxSurpluses::argerr];$Failed); -AllMaxSurpluses[game_,payoff_List, opts:OptionsPattern[AllMaxSurpluses]]:= Module[{dispmat,ausz,sol,mgij,mgji,ergb}, +AllMaxSurpluses[game_,payoff_List, opts:OptionsPattern[AllMaxSurpluses]]:= Block[{dispmat,ausz,sol,mgij,mgji,ergb}, dispmat = OptionValue[DisplayMatrixForm]; ausz = Which[Depth[payoff]==2,{payoff}, Depth[payoff]==3,payoff, @@ -3889,7 +4054,7 @@ of Meinhardt (2013) AllAntiSurpluses[args___]:=(Message[AllAntiSurpluses::argerr];$Failed); -AllAntiSurpluses[game_,payoff_List, opts:OptionsPattern[AllAntiSurpluses]]:= Module[{dispmat,ausz,sol,mgij,mgji,ergb}, +AllAntiSurpluses[game_,payoff_List, opts:OptionsPattern[AllAntiSurpluses]]:= Block[{dispmat,ausz,sol,mgij,mgji,ergb}, dispmat = OptionValue[DisplayMatrixForm]; ausz = Which[Depth[payoff]==2,{payoff}, Depth[payoff]==3,payoff, @@ -3898,7 +4063,7 @@ of Meinhardt (2013) Which[dispmat == False, ergb, True, DisplayResult[ergb]] ]; -DisplayResult[payoff_]:= Module[{surpl,dir,pli,plj,setij,setji,nwij,mgij}, +DisplayResult[payoff_]:= Block[{surpl,dir,pli,plj,setij,setji,nwij,mgij}, surpl = payoff; setij = Partition[listIJ[T],2]; setji = Partition[listJI[T],2]; @@ -3912,7 +4077,7 @@ of Meinhardt (2013) KernelImputationQ[args___]:=(Message[KernelImputationQ::argerr];$Failed); -KernelImputationQ[game_, payoff_List] := Module[{dimpay}, +KernelImputationQ[game_, payoff_List] := Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay] === 2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3), KernelImputQ[game, #] & /@ payoff, @@ -3924,7 +4089,7 @@ of Meinhardt (2013) ]; KernelImputQ[game_, payoff_List] := - Module[{ub,lb,plpr,rvpr,asspay,sij,sji,msrplij,msrplji,msrij,msrji,conj,coni,intvij,intvji,npij,npji,orij,orji,ntmj,ntmi,neq}, + Block[{ub,lb,plpr,rvpr,asspay,sij,sji,msrplij,msrplji,msrij,msrji,conj,coni,intvij,intvji,npij,npji,orij,orji,ntmj,ntmi,neq}, ub=4*10^(-7); lb=-ub; plpr = PlayerPairs[T]; @@ -3970,7 +4135,7 @@ of Meinhardt (2013) KernelImputationListQ[args___]:=(Message[KernelImputationListQ::argerr];$Failed); -KernelImputationListQ[game_, payoff_List] := Module[{kerimpQ,impQ}, +KernelImputationListQ[game_, payoff_List] := Block[{kerimpQ,impQ}, Which[Depth[payoff] == 3, kerimpQ = KernelImputationQ[game, #] &/@ payoff; impQ = CheckImputations[game, #] & /@ payoff; @@ -3986,7 +4151,7 @@ of Meinhardt (2013) ImputationQ[args___]:=(Message[ImputationQ::argerr];$Failed); -ImputationQ[game_,payoff_List]:= Module[{}, +ImputationQ[game_,payoff_List]:= Block[{}, Which[Depth[payoff] == 3, CheckImputations[game, #] & /@ payoff, Depth[payoff] == 2, CheckImputations[game,payoff], True, DisplayMessage[payoff] @@ -3994,12 +4159,12 @@ of Meinhardt (2013) ]; -CheckImputations[game_,payoff_List]:= Module[{impQ}, +CheckImputations[game_,payoff_List]:= Block[{impQ}, impQ = TolImputations[game] /. MapThread[Rule, {x[#] & /@ T, payoff}]; Apply[And, impQ] ]; -TolImputations[game_]:=Module[{tolv,indrat,eff}, +TolImputations[game_]:=Block[{tolv,indrat,eff}, tolv=4*10^(-9); indrat=(x[#] - v[{#}])>=-tolv &/@ T; eff=LessEqual[Abs[x[T]-v[T]],tolv]; @@ -4019,30 +4184,30 @@ of Meinhardt (2013) PreKernelQ[args___]:=(Message[PreKernelQ::argerr];$Failed); -PreKernelQ[game_, payoff_List] :=Module[{tolv,graval,dimpay}, +PreKernelQ[game_, payoff_List] :=Block[{tolv,graval,dimpay}, graval = v[T]; dimpay = Dimensions[payoff]; tolv=1.5*10^(-8); Which[Length[dimpay] === 2, - Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3),MapThread[And,{(Abs[Apply[Plus, #] - graval]<=tolv) & /@ payoff,MaxExcessBalanced[game, payoff]}], + Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3),MapThread[And,{(Abs[Total[#] - graval]<=tolv) & /@ payoff,MaxExcessBalanced[game, payoff]}], True, PrintRemark[payoff]], Length[dimpay] === 1, - Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Apply[Plus, payoff] - graval]<=tolv},{MaxExcessBalanced[game, payoff]}}], + Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Total[payoff] - graval]<=tolv},{MaxExcessBalanced[game, payoff]}}], True, PrintRemark[payoff]], True, PrintRemark[payoff] ] ]; AntiPreKernelQ[args___]:=(Message[AntiPreKernelQ::argerr];$Failed); -AntiPreKernelQ[game_, payoff_List] :=Module[{tolv,graval,dimpay}, +AntiPreKernelQ[game_, payoff_List] :=Block[{tolv,graval,dimpay}, graval = v[T]; dimpay = Dimensions[payoff]; tolv=1.5*10^(-8); Which[Length[dimpay] === 2, - Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3), MapThread[And,{(Abs[Apply[Plus, #] - graval]<= tolv) & /@ payoff,MinExcessBalanced[game, payoff]}], + Which[ (Last[dimpay]===Length[T] && Depth[payoff] ===3), MapThread[And,{(Abs[Total[#] - graval]<= tolv) & /@ payoff,MinExcessBalanced[game, payoff]}], True, PrintRemark[payoff]], Length[dimpay] === 1, - Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Apply[Plus, payoff] - graval]<=tolv},{MinExcessBalanced[game, payoff]}}], + Which[(First[dimpay]===Length[T] && Depth[payoff] === 2 ), MapThread[And,{{Abs[Total[payoff] - graval]<=tolv},{MinExcessBalanced[game, payoff]}}], True, PrintRemark[payoff]], True, PrintRemark[payoff] ] @@ -4053,7 +4218,7 @@ of Meinhardt (2013) KernelCalculation[args___]:=(Message[KernelCalculation::argerr];$Failed); KernelCalculation[game_, opts:OptionsPattern[KernelCalculation]] := - Module[{callm,changeps,dispres, epsi1, fieps, notzeromono, firstcrit,kernres, epsilon, zmonoQ, kernQ, avcQ, orggame, orgval}, + Block[{callm,changeps,dispres, epsi1, fieps, notzeromono, firstcrit,kernres, epsilon, zmonoQ, kernQ, avcQ, orggame, orgval}, Off[Set::setraw]; Off[Set::write]; callm = OptionValue[CallMaximize]; @@ -4106,21 +4271,21 @@ of Meinhardt (2013) ]; DisplayZmQKerQ01[zmQ_,coreQ_] := - Module[{}, + Block[{}, Print["Game is zero-monotone? ",zmQ]; Print["Core is nonempty? ",coreQ]; Print["Game is either zero-monotonic or has nonempty core"] ]; DisplayZmQKerQ02[zmQ_,coreQ_] := - Module[{}, + Block[{}, Print["Game is zero-monotone? ",zmQ]; Print["Core is nonempty? ",coreQ]; Print["Game is not zero-monotonic and has empty core"] ]; DisplayZmQKerQ03[zmQ_,coreQ_] := - Module[{}, + Block[{}, Print["Game is zero-monotone? ",zmQ]; Print["Core is nonempty? ",coreQ]; Print["Core is empty"]; @@ -4129,7 +4294,7 @@ of Meinhardt (2013) DisplayAvcQ[avconQ_] := Print["Game is average-convex? ",avconQ]; DisplayRemark[eps_Real] := - Module[{}, + Block[{}, Print["Depth is equal to ",Depth[eps]]; Print["Usage: Kernel[game,options]"]; Print["and KernelCalculation[game,options]"]; @@ -4141,7 +4306,7 @@ of Meinhardt (2013) KernelSubCallEmpty[game_,callm_,changeps_,dispres_,opts:OptionsPattern[KernelCalculation]] := - Module[{epsi1,notzeromono,critical,kernres}, + Block[{epsi1,notzeromono,critical,kernres}, epsi1 = OptionValue[EpsilonValue]; notzeromono = OptionValue[SetGameToNonZeroMonotonic]; critical = Which[changeps == False, epsi1, True, SecondCriticalVal[game][[1, 2]]]; @@ -4151,7 +4316,7 @@ of Meinhardt (2013) ]; KernelSubCall[game_,callm_,changeps_,dispres_,opts:OptionsPattern[KernelCalculation]] := - Module[{epsi1,notzeromono,critical,kernres}, + Block[{epsi1,notzeromono,critical,kernres}, epsi1 = OptionValue[EpsilonValue]; notzeromono = OptionValue[SetGameToNonZeroMonotonic]; critical = Which[changeps == False, epsi1, True, FourthCriticalVal[game][[1, 2]]]; @@ -4162,7 +4327,7 @@ of Meinhardt (2013) KernelSubCallZero[game_,callm_,changeps_,dispres_,opts:OptionsPattern[KernelCalculation]] := - Module[{epsi1,notzeromono,critical,kernres,kernsol}, + Block[{epsi1,notzeromono,critical,kernres,kernsol}, epsi1 = OptionValue[EpsilonValue]; notzeromono = OptionValue[SetGameToNonZeroMonotonic]; critical = Which[changeps == False, epsi1, True, StarCriticalVal[game][[1, 2]]]; @@ -4189,7 +4354,7 @@ as described in Meinhardt(2006). Recursive procedure. *) KernelPoints[game_, storepay_:{}, callm_, changeps_, dispres_, opts:OptionsPattern[KernelCalculation]] := - Module[{epsi1, notzeromono, ruf, zwerg, initialpay = storepay, folg, rf, del, alloc, po, newgame, maxsets, tijsets, mengsys, reslofSt2, constofSt2, const = {}, var, subres,sol, reddel,unpay, retval, objfunc, epsilon, leastgame}, + Block[{epsi1, notzeromono, ruf, zwerg, initialpay = storepay, folg, rf, del, alloc, po, newgame, maxsets, tijsets, mengsys, reslofSt2, constofSt2, const = {}, var, subres,sol, reddel,unpay, retval, objfunc, epsilon, leastgame}, epsi1 = OptionValue[EpsilonValue]; notzeromono = OptionValue[SetGameToNonZeroMonotonic]; epsilon = epsi1; @@ -4208,7 +4373,7 @@ as described in Meinhardt(2006). Recursive procedure. maxsets = Extract[Subsets[T], #] & /@ po; mengsys = MapThread[Intersection[#1,#2] &, {maxsets, tijsets}]; const = NewConstraints[mengsys, const, del, epsi1]; - objfunc = Apply[Plus, var]; + objfunc = Total[var]; const = Flatten[Join[Append[const, objfunc <= v[T]]]]; reddel = Sort[-Union[del]]; {reslofSt2, constofSt2} = FeasibleConstraints[const, reddel, callm]; @@ -4246,13 +4411,13 @@ as described in Meinhardt(2006). Recursive procedure. MessageKerPoints01[erg_] := - Module[{}, + Block[{}, Print["At least one player outweighs another player."]; Print["A further calculation loop is required.\n", erg]; ]; MessageKerPoints02 := - Module[{}, + Block[{}, Print["Solution is not balanced."]; Print["The solution found may be a Kernel element."]; Print["Check solution with the function KernelImputationQ or MaxExcessBalanced."]; @@ -4262,7 +4427,7 @@ as described in Meinhardt(2006). Recursive procedure. (* Description of the algorithm can be found in section 5 in Meinhardt (2006) *) Kernel[args___]:=(Message[Kernel::argerr];$Failed); -Kernel[game_,opts:OptionsPattern[Kernel]] := Module[{chopt, dispres, eps, kersol, coreq,orgval,callm}, +Kernel[game_,opts:OptionsPattern[Kernel]] := Block[{chopt, dispres, eps, kersol, coreq,orgval,callm}, dispres = OptionValue[DisplayAllResults]; eps = OptionValue[EpsilonValue]; callm = OptionValue[CallMaximize]; @@ -4280,11 +4445,11 @@ as described in Meinhardt(2006). Recursive procedure. ]; KernelSubCallFir[game_,dispres_,callm_]:= -Module[{firstcrit,seccrit,newgame,nb,alldelvar,dvar,objfunc,var,solut,kersol,tra}, +Block[{firstcrit,seccrit,newgame,nb,alldelvar,dvar,objfunc,var,solut,kersol,tra}, firstcrit = FirstCriticalVal[game][[1,2]]; newgame = EpsValue[game, firstcrit]; {nb,alldelvar,dvar} = AllConstraints[newgame]; - objfunc= Apply[Plus,dvar]; + objfunc= Total[dvar]; var= Union[x /@ T, alldelvar]; solut = Which[SameQ[callm,False],ConstrainedMax[objfunc,nb,var], True,Rationalize[NMaximize[Prepend[nb,objfunc],var],10^(-12)]]; @@ -4295,9 +4460,9 @@ as described in Meinhardt(2006). Recursive procedure. KernelSubCallSec[game_,dispres_,callm_]:= -Module[{nb,alldelvar,dvar,objfunc,var,solut,kersol,tra}, +Block[{nb,alldelvar,dvar,objfunc,var,solut,kersol,tra}, {nb,alldelvar,dvar} = AllConstraints[game]; - objfunc= Apply[Plus,dvar]; + objfunc= Total[dvar]; var= Union[x /@ T, alldelvar]; solut = Which[SameQ[callm,False],ConstrainedMax[objfunc,nb,var], True,Rationalize[NMaximize[Prepend[nb,objfunc],var],10^(-12)]]; @@ -4308,10 +4473,10 @@ as described in Meinhardt(2006). Recursive procedure. ]; KernelSubCallThir[game_,eps_,dispres_,callm_]:= -Module[{newgame,nb,alldelvar,dvar,objfunc,var,solut,kersol,tra}, +Block[{newgame,nb,alldelvar,dvar,objfunc,var,solut,kersol,tra}, newgame = EpsValue[game, eps]; {nb,alldelvar,dvar} = AllConstraints[newgame]; - objfunc= Apply[Plus,dvar]; + objfunc= Total[dvar]; var= Union[x /@ T, alldelvar]; solut = Which[SameQ[callm,False],ConstrainedMax[objfunc,nb,var], True,Rationalize[NMaximize[Prepend[nb,objfunc],var],10^(-12)]]; @@ -4326,7 +4491,7 @@ as described in Meinhardt(2006). Recursive procedure. AllConstraints[args___]:=(Message[AllConstraints::argerr];$Failed); AllConstraints[game_]:= - Module[{anf=T,rest,pi,pj,const,conset={},sub,deltaset={},deltavar={},newconst,constsys}, + Block[{anf=T,rest,pi,pj,const,conset={},sub,deltaset={},deltavar={},newconst,constsys}, While[Length[anf]>1, pi=First[anf]; rest=Drop[anf,1]; @@ -4349,7 +4514,7 @@ as described in Meinhardt(2006). Recursive procedure. KernelVertices[args___]:=(Message[KernelVertices::argerr];$Failed); KernelVertices[game_, opts:OptionsPattern[KernelVertices]] := - Module[{callm, sil, epsval, fieps, kerli, ratkli, sol, obj, const, var, trans,kerQ,posker,prkQ,posprk,kl,pkl}, + Block[{callm, sil, epsval, fieps, kerli, ratkli, sol, obj, const, var, trans,kerQ,posker,prkQ,posprk,kl,pkl}, callm = OptionValue[CallMaximize]; sil = OptionValue[Silent]; epsval = OptionValue[EpsilonValue]; @@ -4373,8 +4538,8 @@ as described in Meinhardt(2006). Recursive procedure. DetermineAddVertices[sol_, obj_, const_ , var_ , T_, callm_,sil_, zf_:{}] := - Module[{nwzf,dures,valzf,boolzf,dualvar,yset,duyp,newineq,nwsol,prmax,lngt,kersolQ,oldres=sol}, - nwzf = Apply[Plus, var]; + Block[{nwzf,dures,valzf,boolzf,dualvar,yset,duyp,newineq,nwsol,prmax,lngt,kersolQ,oldres=sol}, + nwzf = Total[var]; dures = SolveDual[nwzf, const, var]; valzf = dures[[1]]; boolzf = SameQ[valzf,zf]; @@ -4413,14 +4578,14 @@ as described in Meinhardt(2006). Recursive procedure. AntiPreKernelSolution[args___]:=(Message[AntiPreKernelSolution::argerr];$Failed); AntiPreKernelSolution[game_,opts:OptionsPattern[AntiPreKernelSolution]] := - Module[{pay}, + Block[{pay}, pay = Table[v[T],{Length[T]}]/Length[T]; AntiPreKernelSolution[game,pay,opts] ]; AntiPreKernelSolution[game_, payoff_List, opts:OptionsPattern[AntiPreKernelSolution]] := - Module[{showzf,rattol,conjfu,sil,anti,mth,ext}, + Block[{showzf,rattol,conjfu,sil,anti,mth,ext}, showzf = OptionValue[ShowObjectiveFunction]; rattol = OptionValue[RationalTol]; conjfu = OptionValue[ConjugateFunction]; @@ -4441,14 +4606,14 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the PreKernelSolution[args___]:=(Message[PreKernelSolution::argerr];$Failed); PreKernelSolution[game_,opts:OptionsPattern[PreKernelSolution]] := - Module[{pay}, + Block[{pay}, pay = Table[v[T],{Length[T]}]/Length[T]; PreKernelSolution[game,pay,opts] ]; PreKernelSolution[game_, payoff_List, opts:OptionsPattern[PreKernelSolution]] := - Module[{dimCorQ, showzf,rattol,conjfu,sil,anti,mth,ext,allres,ratres,res,detobj,grad,conj,smc,rclim}, + Block[{dimCorQ, showzf,rattol,conjfu,sil,anti,mth,ext,allres,ratres,res,detobj,grad,conj,smc,rclim}, Off[FindMinimum::fmgz]; dimCorQ = Which[Depth[payoff] === 3, If[Length[#] === Length[T],True, False]&/@ payoff, Depth[payoff] === 2, If[Length[payoff]===Length[T],True, False], @@ -4496,11 +4661,11 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the ]; WrongDimension:=(Print["Payoff vector has not the correct dimension!"]); -WrongCoordDimension[T_]:= Module[{}, +WrongCoordDimension[T_]:= Block[{}, Print["List of unanimity coordinates of size 2 has not the correct length!"]; Print["The correct dimension is: ", Binomial[Length[T],2]]; ]; -WrongCoordDimension[coord_List,T_]:= Module[{}, +WrongCoordDimension[coord_List,T_]:= Block[{}, Print["List of unanimity coordinates of length ", Length[coord]]; Print["is not correct!"]; Print["The correct dimension is: ", 2^Length[T]]; @@ -4509,7 +4674,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the FormatConjugateRes[game_,detobj_List, opts:OptionsPattern[PreKernelSolution]]:= - Module[{sil,cr,gradv,cflist}, + Block[{sil,cr,gradv,cflist}, sil = OptionValue[Silent]; ext = OptionValue[SolutionExact]; cr = ConvexConjugate[game,#, Silent -> sil, SolutionExact -> False]&/@ detobj; @@ -4523,7 +4688,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the *) SDMPreKernel[game_, payoff_List,optval_, opts:OptionsPattern[PreKernelSolution]] := - Module[{smc,sil,anti,mth,rattol,ext,rl,obj,var,init,minval,nwpay,tolv,meff,matE,matQ,vmeff,ralpv,alpv,bvec,solpay,maxexc,sumexc,dfpy,leq,zfval = optval}, + Block[{smc,sil,anti,mth,rattol,ext,rl,obj,var,init,minval,nwpay,tolv,meff,matE,matQ,vmeff,ralpv,alpv,bvec,solpay,maxexc,sumexc,dfpy,leq,zfval = optval}, anti = OptionValue[AntiPreKernel]; ext = OptionValue[SolutionExact]; mth = OptionValue[Method]; @@ -4538,11 +4703,11 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the matE = -SetsToVec[meff, T, EffVector -> True]; matQ = 2*Transpose[matE].matE; vmeff=Map[v[#] &, #] & /@ meff; - ralpv = {1, -1}.# & /@ vmeff; + ralpv = {1., -1.}.# & /@ vmeff; alpv = Prepend[ralpv,v[T]]; bvec = 2*Transpose[matE].alpv; ]; - init = MapThread[List, {var, payoff}]; + init = MapThread[List, {var,payoff}]; minval = Which[SameQ[ext,False], If[SameQ[sil,True], FindMinimum[obj, init, Method -> mth], (*Approximate solution *) FindMinimum[obj, init, Method -> mth, StepMonitor :> Print[init]]], True, SolveLinEQ[matQ,bvec,var, Method -> mth, Silent -> sil] (* Try to find an exact solution *) @@ -4553,7 +4718,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the leq=MapThread[LessEqual, {dfpy,tolv}]; If[SameQ[leq,True],Return[solpay],nwpay=solpay]; maxexc = If[SameQ[anti,False],MaxSurpluses[game,nwpay],AntiSurpluses[game,nwpay]]; - sumexc = Apply[Plus, Flatten[MapThread[Subtract[#2, #1]^2 &, Outer[List, #]] & /@ maxexc]]; + sumexc = Total[Flatten[MapThread[Subtract[#2, #1]^2 &, Outer[List, #]] & /@ maxexc]]; If[SameQ[sil,False],MessageSDMKer[obj,minval,nwpay,minval[[1]],maxexc,sumexc]; If[SameQ[ext,False], SolveLinEQ[matQ,bvec,var, Method -> mth, Silent -> False],True],True]; If[Chop[Rationalize[sumexc,rattol] ] === 0, nwpay, @@ -4561,7 +4726,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the ]; MessageSDMKer[zfc_,minw_,nwaz_, fucval_, mexc_, addexc_] := - Module[{}, + Block[{}, Print["The objective function h is: ",zfc]; Print["The local minimum of h is: ",N[minw[[1]]]]; Print["The local minimum of the objective function h is at:\n ",nwaz]; @@ -4574,7 +4739,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the (* Solving a system of linear equations to find an exact solution.*) SolveLinEQ[coefmat_List,bv_List,indvar_List,opts:OptionsPattern[PreKernelSolution]]:= - Module[{sil,mth,foc,syseq,rest,rl,sol}, + Block[{sil,mth,foc,syseq,rest,rl,sol}, sil = OptionValue[Silent]; mth = OptionValue[Method]; If[sil===False, MessageSolveLinEQ[coefmat,bv];, True]; @@ -4593,7 +4758,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the ]; MessageSolveLinEQ[cfmat_,bvec_] := - Module[{alpscal}, + Block[{alpscal}, alpscal = Norm[bvec]^2; Print["The matrix of the objective function is given by:\n", cfmat]; Print["Is the matrix singular? \n", Det[cfmat]==0]; @@ -4605,13 +4770,13 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the (* Trying to determine the complete solution set of the objective function h whenever the coefficient matrix is singular *) DetSolSet[dfconjugate_List, objf_, xvar_List, pvar_List]:= - Module[{objdf,orgmat,orgrest,bgvec,partsol,sparts,cgmat,gensol,solvecs,unsol,mpres}, + Block[{objdf,orgmat,orgrest,bgvec,partsol,sparts,cgmat,gensol,solvecs,unsol,mpres}, objdf = Simplify[D[objf[[1]],#]] &/@ xvar; orgmat = Coefficient[#, xvar] & /@ objdf; orgrest = objf[[1]] - (1/2) xvar.orgmat.xvar; bgvec = Coefficient[orgrest,xvar]; partsol=PseudoInverse[orgmat].(-bgvec); - sparts=Apply[Plus,partsol]; + sparts=Total[partsol]; cgmat=Coefficient[#, pvar] & /@ dfconjugate; gensol = NullSpace[cgmat][[1]]; solvecs = partsol + (IdentityMatrix[Length[pvar]] - PseudoInverse[orgmat].orgmat)gensol; @@ -4623,9 +4788,9 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the ]; CheckGenRes[vecli_List,pvec_List,psum_?NumberQ]:= - Module[{sumuns,cksum,psck,extps,res}, - sumuns= Which[Length[vecli]>1, Apply[Plus,#] &/@ vecli, - True,Apply[Plus,vecli]]; + Block[{sumuns,cksum,psck,extps,res}, + sumuns= Which[Length[vecli]>1, Total[#] &/@ vecli, + True,Total[vecli]]; cksum = Which[Length[sumuns]>1,Equal[psum,#] &/@ sumuns, True, Equal[psum,sumuns]]; psck = Position[cksum,True]; @@ -4643,7 +4808,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the *) DetObjFunc[game_, payoff_List,opts:OptionsPattern[PreKernelSolution]] := - Module[{anti, smc, sil, bestc, maxsl, crlist, eqs, eff, obj}, + Block[{anti, smc, sil, bestc, maxsl, crlist, eqs, eff, obj}, sil = OptionValue[Silent]; anti = OptionValue[AntiPreKernel]; smc = OptionValue[SmallestCardinality]; @@ -4656,9 +4821,9 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the max surpluses for each pair of players i,j in T. *) eqs = MapThread[Subtract[#1, #2]^2 &, #] & /@ crlist; - obj = Apply[Plus, eqs]; + obj = Total[eqs]; (* efficiency *) - eff = (Apply[Plus, x[#] & /@ T] - v[T])^2; + eff = (Total[x[#] & /@ T] - v[T])^2; (* Meinhardt (2013) formula 7.7 *) obj[[1]] + eff ]; @@ -4669,7 +4834,7 @@ The indirect characteristic function is the conjugate (Fenchel transform) of the *) -PrintMostEff[payoff_List, meffc_List] := Module[{}, +PrintMostEff[payoff_List, meffc_List] := Block[{}, Print["A set of most effective coalitions at payoff ", payoff, " is: \n", meffc]; ]; @@ -4744,7 +4909,7 @@ as described in Meinhardt (2013). (* User interface to compute an equivalence matrix and its intermediate results. *) ImputationToMatrix[args___]:=(Message[ImputationToMatrix::argerr];$Failed); -ImputationToMatrix[game_, payoff_List, opts:OptionsPattern[BestCoalToMatrix]] := Module[{dimpay}, +ImputationToMatrix[game_, payoff_List, opts:OptionsPattern[BestCoalToMatrix]] := Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay]===2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3) , ImputToMatrixMain[game,#, opts]&/@ payoff //Union, @@ -4757,14 +4922,14 @@ as described in Meinhardt (2013). ]; -ImputToMatrixMain[game_, payoff_List, opts:OptionsPattern[BestCoalToMatrix]]:= Module[{meff}, +ImputToMatrixMain[game_, payoff_List, opts:OptionsPattern[BestCoalToMatrix]]:= Block[{meff}, meff = BestCoalitions[game, payoff, opts]; BestCoalToMatrix[meff, T, opts] ]; BestCoalToMatrix[args___]:=(Message[BestCoalToMatrix::argerr];$Failed); BestCoalToMatrix[coal_List, T_List, opts:OptionsPattern[BestCoalToMatrix]] := - Module[{allsol,dismat,zrv, pscoal, replzr, vecij, allmij, detQij, sumQij, detsum, mQ, + Block[{allsol,dismat,zrv, pscoal, replzr, vecij, allmij, detQij, sumQij, detsum, mQ, detq}, allsol = OptionValue[DisplayAllResults]; dismat = OptionValue[DisplayMatrixForm]; @@ -4788,7 +4953,7 @@ as described in Meinhardt (2013). (* User interface to compute a strength matrix. (see Meinhardt 2013) *) ImputationToVec[args___]:=(Message[ImputationToVec::argerr];$Failed); -ImputationToVec[game_, payoff_List, opts:OptionsPattern[ImputationToVec]] := Module[{dimpay}, +ImputationToVec[game_, payoff_List, opts:OptionsPattern[ImputationToVec]] := Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay]===2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3) , ImputToVecMain[game,#, opts]&/@ payoff //Union, @@ -4801,7 +4966,7 @@ as described in Meinhardt (2013). ]; -ImputToVecMain[game_, payoff_List, opts:OptionsPattern[ImputationToVec]]:= Module[{allr, fav, meff, stsv, skew}, +ImputToVecMain[game_, payoff_List, opts:OptionsPattern[ImputationToVec]]:= Block[{allr, fav, meff, stsv, skew}, allr = OptionValue[DisplayAllResults]; fav = OptionValue[InFavor]; meff = BestCoalitions[game, payoff, opts]; @@ -4817,7 +4982,7 @@ as described in Meinhardt (2013). SetsToVec[args___]:=(Message[SetsToVec::argerr];$Failed); SetsToVec[mg_List, T_List, opts:OptionsPattern[SetsToVec]] := - Module[{effvec, zrv, pscoal, replzr,coasts, onesoft}, + Block[{effvec, zrv, pscoal, replzr,coasts, onesoft}, effvec = OptionValue[EffVector]; zrv = Table[0, {i, Length[T]}]; pscoal = Outer[List, #] & /@ mg; @@ -4835,7 +5000,7 @@ as described in Meinhardt (2013). (* User interface to determine an equivalence class from an imputation. *) ImputationToEqClass[args___]:=(Message[ImputationToEqClass::argerr];$Failed); -ImputationToEqClass[game_, payoff_List, opts:OptionsPattern[ImputationToEqClass]] := Module[{dimpay}, +ImputationToEqClass[game_, payoff_List, opts:OptionsPattern[ImputationToEqClass]] := Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay]===2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3) , EqClassMain[game,#, opts]&/@ payoff //Union, @@ -4848,32 +5013,32 @@ as described in Meinhardt (2013). ]; -EqClassMain[game_, payoff_, opts:OptionsPattern[ImputationToEqClass]]:= Module[{unmatQ, unm}, +EqClassMain[game_, payoff_, opts:OptionsPattern[ImputationToEqClass]]:= Block[{unmatQ, unm}, unmatQ = OptionValue[BargUnanMat]; unm = BargainUnanMatrix[game,payoff, EffVector -> False]; If[unmatQ === False, DetEqClass[unm, T],{DetEqClass[unm, T], unm}] ]; DetEqClass[args___]:=(Message[DetEqClass::argerr];$Failed); -DetEqClass[mat_List,T_]:= Module[{}, +DetEqClass[mat_List,T_]:= Block[{}, Which[Dimensions[mat]==={Binomial[ Length[T],2], 2^Length[T]-1}, FuncDetEqClass[mat, T], True, WrongMatDimension[T]] ]; -WrongMatDimension[T_]:= Module[{}, +WrongMatDimension[T_]:= Block[{}, Print["The unanimity matrix has not the correct dimension!"]; Print["The correct dimension is: ", {Binomial[Length[T],2],2^Length[T]-1}]; ]; -FuncDetEqClass[mat_List, T_] := Module[{gb, clmat}, +FuncDetEqClass[mat_List, T_] := Block[{gb, clmat}, gb = GameBasis[T]; clmat = -mat.Inverse[gb]; FindEqClass[#, T] & /@ clmat ]; -FindEqClass[dir_List, T_] := Module[{pwmg, lhs, rhs}, +FindEqClass[dir_List, T_] := Block[{pwmg, lhs, rhs}, pwmg = Drop[Subsets[T], 1]; lhs = Flatten[Position[dir, -1]]; rhs = Flatten[Position[dir, 1]]; @@ -4881,7 +5046,7 @@ as described in Meinhardt (2013). ]; BargainUnanMatrix[args___]:=(Message[BargainUnanMatrix::argerr];$Failed); -BargainUnanMatrix[game_, payoff_List, opts:OptionsPattern[BargainUnanMatrix]] := Module[{effvec,meff,detunan,onesv}, +BargainUnanMatrix[game_, payoff_List, opts:OptionsPattern[BargainUnanMatrix]] := Block[{effvec,meff,detunan,onesv}, effvec = OptionValue[EffVector]; meff = BestCoalitions[game, payoff, EffVector -> effvec]; detunan=DetUnanMat[meff, T]; @@ -4890,13 +5055,13 @@ as described in Meinhardt (2013). ]; -DetUnanMat[bsccoal_List, T_] := Module[{powers}, +DetUnanMat[bsccoal_List, T_] := Block[{powers}, powers = Drop[Subsets[T], 1]; DetDircSetIJ[#, powers] & /@ bsccoal ]; -DetDircSetIJ[bsccoal_List, coal_List] := Module[{lvec, rvec}, +DetDircSetIJ[bsccoal_List, coal_List] := Block[{lvec, rvec}, lvec = If[SubSetQ[#, bsccoal[[1]]], 1, 0] & /@ coal; rvec = If[SubSetQ[#, bsccoal[[2]]], -1, 0] & /@ coal; lvec + rvec @@ -4904,12 +5069,12 @@ as described in Meinhardt (2013). (* User interface to compute the value of excesses, that is, function h. (Meinhardt, 2013) *) ValueExcess[args___]:=(Message[ValueExcess::argerr];$Failed); -ValueExcess[excli_List] := Module[{subexc}, +ValueExcess[excli_List] := Block[{subexc}, subexc = Flatten[MapThread[Subtract[#1, #2] &, Outer[List, #]] & /@ excli[[1]]]; - Apply[Plus, subexc^2] + Total[subexc^2] ]; -ValueExcess[game_, payoff_List] := Module[{dimpay}, +ValueExcess[game_, payoff_List] := Block[{dimpay}, dimpay = Dimensions[payoff]; Which[Length[dimpay]===2, Which[(Last[dimpay]===Length[T] && Depth[payoff] ===3) , ValueExcessList[game,#]&/@ payoff, @@ -4922,15 +5087,15 @@ as described in Meinhardt (2013). ]; -ValueExcessList[game_, payoff_List] := Module[{subexc, excli}, +ValueExcessList[game_, payoff_List] := Block[{subexc, excli}, excli = MaxSurpluses[game, payoff]; subexc = Flatten[MapThread[Subtract[#1, #2] &, Outer[List, #]] & /@ excli]; - Apply[Plus, subexc^2] + Total[subexc^2] ]; (* User interface to compute an optimal step size. *) OptStepSize[args___]:=(Message[OptStepSize::argerr];$Failed); -OptStepSize[game_, payoff_List, opts:OptionsPattern[OptStepSize]] := Module[{sil,smc,dimpay}, +OptStepSize[game_, payoff_List, opts:OptionsPattern[OptStepSize]] := Block[{sil,smc,dimpay}, sil = OptionValue[Silent]; smc = OptionValue[SmallestCardinality]; dimpay = Dimensions[payoff]; @@ -4988,12 +5153,12 @@ as described in Meinhardt (2013). (* User interface to compute a pre-kernel element. *) PreKernelElement[args___]:=(Message[PreKernelElement::argerr];$Failed); PreKernelElement[game_,opts:OptionsPattern[PreKernelElement]] := - Module[{pay}, + Block[{pay}, pay = Table[v[T],{Length[T]}]/Length[T]; PreKernelElement[game,pay,opts] ]; -PreKernelElement[game_, payoff_List, opts:OptionsPattern[PreKernelElement]] := Module[{dimpay,rclim}, +PreKernelElement[game_, payoff_List, opts:OptionsPattern[PreKernelElement]] := Block[{dimpay,rclim}, dimpay = Dimensions[payoff]; rclim=If[Length[T] > 11,256,156]; Which[Length[dimpay]===2, @@ -5009,7 +5174,7 @@ as described in Meinhardt (2013). (* Main Functions *) FuncPreKernelElement[game_, payoff_List, opts:OptionsPattern[PreKernelElement]] := -Module[{sil, smc, optst, doi, mex, optstep, itpay,tol,brc,pinv}, +Block[{sil, smc, optst, doi, mex, optstep, itpay,tol,brc,pinv}, sil = OptionValue[Silent]; smc = OptionValue[SmallestCardinality]; optst = OptionValue[CalcStepSize]; @@ -5028,18 +5193,18 @@ as described in Meinhardt (2013). DirectionOfImprovement[args___]:=(Message[DirectionOfImprovement::argerr];$Failed); DirectionOfImprovement[game_, payoff_List, opts:OptionsPattern[DirectionOfImprovement]] := -Module[{sil, smc, optst, meff, matE, matQ, matP, varpay, mex, mopt,submex, setpay, grmex, doi, optstep,pinv}, +Block[{sil, smc, optst, meff, matE, matQ, matP, varpay, mex, mopt,submex, setpay, grmex, doi, optstep,pinv}, sil = OptionValue[Silent]; smc = OptionValue[SmallestCardinality]; optst = OptionValue[CalcStepSize]; pinv = OptionValue[PseudoInv]; mopt= OptionValue[MaximumSurpluses]; {meff, mex} = BestCoalitions[game, payoff, MaximumSurpluses -> True, SmallestCardinality -> smc]; - matE = -SetsToVec[meff, T, EffVector -> True]; - submex = {1, -1}.# & /@ mex; + matE = -SetsToVec[meff, T, EffVector -> True] // N; + submex = {1., -1.}.# & /@ mex; varpay = x[#] & /@ T; setpay = MapThread[Rule, {varpay, payoff}]; - grmex = v[T] - Apply[Plus, x[#] & /@ T] /. setpay; + grmex = v[T] - Total[x[#] & /@ T] /. setpay; PrependTo[submex, grmex]; If[SameQ[sil,False], Print["submex=", submex],True]; If[SameQ[pinv,False], @@ -5050,7 +5215,7 @@ as described in Meinhardt (2013). ]; DelStar[doi_List, matE_List, smex_List]:= - Module[{edvec,nrsq,tol}, + Block[{edvec,nrsq,tol}, edvec = matE.doi; nrsq =Norm[edvec]^2; tol=1.5*10^(-12); @@ -5068,7 +5233,7 @@ as described in Meinhardt (2013). ConvexConjugate[args___]:=(Message[ConvexConjugate::argerr];$Failed); ConvexConjugate[game_, confunc_,opts:OptionsPattern[ConvexConjugate]] := - Module[{sil, cfunc, var, norvar, zerovec, inprod, funchst, gradx, detsys, sol,coefm,solset, sol1, cgate, + Block[{sil, cfunc, var, norvar, zerovec, inprod, funchst, gradx, detsys, sol,coefm,solset, sol1, cgate, dpcgate, detsol, rlz, gradpv}, sil = OptionValue[Silent]; cfunc = If[Head[confunc]=== List, Flatten[confunc],{confunc}]; @@ -5077,7 +5242,7 @@ as described in Meinhardt (2013). var = x[#] & /@ T; norvar = Global`p[#] & /@ T; zerovec = Table[0, {i, Length[T]}]; - inprod = Apply[Plus, MapThread[Times[#1, #2] &, {norvar, var}]]; + inprod = Total[MapThread[Times[#1, #2] &, {norvar, var}]]; funchst = inprod - cfunc // Simplify; gradx = D[funchst[[1]], #] & /@ var; coefm=Coefficient[#,var] &/@ gradx; @@ -5098,7 +5263,7 @@ as described in Meinhardt (2013). MessageConjugate := Print["Warning: The system of linear equations to determine the conjugate of h has no solution."]; -SolSys[eqsys_List,var_List]:=Module[{redsol}, +SolSys[eqsys_List,var_List]:=Block[{redsol}, redsol = Reduce[eqsys,var]; redsol = redsol /. Equal -> Rule; Apply[List,redsol] @@ -5156,7 +5321,7 @@ as described in Meinhardt (2013). CddVerticesCore[args___]:=(Message[CddVerticesCore::argerr];$Failed); CddVerticesCore[game_,opts:OptionsPattern[CddVerticesCore]] := - Module[{ratexact,liste,mat,values,extmat,string1,m,d1,vert1,linearity1,incidences1}, + Block[{ratexact,liste,mat,values,extmat,string1,m,d1,vert1,linearity1,incidences1}, ratexact = OptionValue[RationalExact]; liste = Table[If[i>=j,1,0],{i,Length[T]},{j,Length[T]}]; mat = Flatten[Permutations[#] & /@ liste,1]; @@ -5174,7 +5339,7 @@ as described in Meinhardt (2013). CddVerticesImputationSet[args___]:=(Message[CddVerticesImputationSet::argerr];$Failed); CddVerticesImputationSet[game_,opts:OptionsPattern[CddVerticesReasonableSet]] := - Module[{ratexact,liste, zwmat, finmat, bvec, extmat, string1, m, d1, vert1, linearity1, incidences1, sortlist}, + Block[{ratexact,liste, zwmat, finmat, bvec, extmat, string1, m, d1, vert1, linearity1, incidences1, sortlist}, ratexact = OptionValue[RationalExact]; liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; zwmat = Flatten[Permutations[#] & /@ liste, 1]; @@ -5192,7 +5357,7 @@ as described in Meinhardt (2013). CddVerticesReasonableSet[args___]:=(Message[CddVerticesReasonableSet::argerr];$Failed); CddVerticesReasonableSet[game_,opts:OptionsPattern[CddVerticesReasonableSet]] := - Module[{propcont,ratexact,liste, zwmat, finmat, bvec, extmat, string1, m, d1, vert1, linearity1, incidences1, sortlist}, + Block[{propcont,ratexact,liste, zwmat, finmat, bvec, extmat, string1, m, d1, vert1, linearity1, incidences1, sortlist}, ratexact = OptionValue[RationalExact]; propcont = OptionValue[ProperContribution]; liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; @@ -5215,7 +5380,7 @@ as described in Meinhardt (2013). CddVerticesLowerSet[args___]:=(Message[CddVerticesLowerSet::argerr];$Failed); CddVerticesLowerSet[game_,opts:OptionsPattern[CddVerticesLowerSet]] := - Module[{ratexact,liste, zwmat, finmat, bvec, smc, extmat, string1, m, d1, vert1, linearity1, incidences1, sortlist}, + Block[{ratexact,liste, zwmat, finmat, bvec, smc, extmat, string1, m, d1, vert1, linearity1, incidences1, sortlist}, ratexact = OptionValue[RationalExact]; liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; zwmat = Flatten[Permutations[#] & /@ liste, 1]; @@ -5237,7 +5402,7 @@ as described in Meinhardt (2013). CddGmpVerticesCore[args___]:=(Message[CddGmpVerticesCore::argerr];$Failed); CddGmpVerticesCore[game_,opts:OptionsPattern[CddGmpVerticesCore]] := - Module[{ratexact,withinc,liste,mat,values,extmat,string1,string2,m,d1,vert1,vertlist1,linearity1,incidences1,sortlist}, + Block[{ratexact,withinc,liste,mat,values,extmat,string1,string2,m,d1,vert1,vertlist1,linearity1,incidences1,sortlist}, ratexact = OptionValue[RationalExact]; withinc = OptionValue[WithIncidences]; liste = Table[If[i>=j,1,0],{i,Length[T]},{j,Length[T]}]; @@ -5264,7 +5429,7 @@ as described in Meinhardt (2013). CddGmpPlotCore[args___]:=(Message[CddGmpPlotCore::argerr];$Failed); CddGmpPlotCore[game_,opts:OptionsPattern[CddGmpPlotCore]] := - Module[{ratexact,liste,mat,values,extmat,string1,m1,d1,vert1,vertlist1,linearity1,sortlist1,ecdlist1,eadlist1,icdlist1,iadlist1}, + Block[{ratexact,liste,mat,values,extmat,string1,m1,d1,vert1,vertlist1,linearity1,sortlist1,ecdlist1,eadlist1,icdlist1,iadlist1}, ratexact = OptionValue[RationalExact]; liste = Table[If[i>=j,1,0],{i,Length[T]},{j,Length[T]}]; mat = Flatten[Permutations[#] & /@ liste,1]; @@ -5281,7 +5446,7 @@ as described in Meinhardt (2013). CddGmpPlotImputationSet[args___]:=(Message[CddGmpPlotImputationSet::argerr];$Failed); CddGmpPlotImputationSet[game_] := - Module[{liste, zwmat, finmat, bvec, extmat, m, d1, vert1, string1, vertlist1, linearity1, sortlist, ecdlist1,eadlist1,icdlist1,iadlist1}, + Block[{liste, zwmat, finmat, bvec, extmat, m, d1, vert1, string1, vertlist1, linearity1, sortlist, ecdlist1,eadlist1,icdlist1,iadlist1}, liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; zwmat = Flatten[Permutations[#] & /@ liste, 1]; finmat = Append[Take[zwmat, Length[T]], Last[zwmat]]; @@ -5297,7 +5462,7 @@ as described in Meinhardt (2013). CddGmpImputationVertices[args___]:=(Message[CddGmpImputationVertices::argerr];$Failed); CddGmpImputationVertices[game_] := - Module[{liste,zwmat,finmat,bvec,extmat,m,d1,vert1,string1,linearity1,sortlist,ecdlist1,eadlist1,icdlist1,iadlist1}, + Block[{liste,zwmat,finmat,bvec,extmat,m,d1,vert1,string1,linearity1,sortlist,ecdlist1,eadlist1,icdlist1,iadlist1}, liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; zwmat = Flatten[Permutations[#] & /@ liste, 1]; finmat = Append[Take[zwmat, Length[T]], Last[zwmat]]; @@ -5312,7 +5477,7 @@ as described in Meinhardt (2013). CddGmpPlotReasonableSet[args___]:=(Message[CddGmpPlotReasonableSet::argerr];$Failed); CddGmpPlotReasonableSet[game_,opts:OptionsPattern[CddGmpPlotReasonableSet]] := - Module[{propcont,liste, zwmat, finmat, reasout,propout,bvec, extmat, m, d1, vert1, vertlist1, string1, linearity1, incidences1, sortlist,ecdlist1,eadlist1,icdlist1,iadlist1}, + Block[{propcont,liste, zwmat, finmat, reasout,propout,bvec, extmat, m, d1, vert1, vertlist1, string1, linearity1, incidences1, sortlist,ecdlist1,eadlist1,icdlist1,iadlist1}, propcont = OptionValue[ProperContribution]; liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; zwmat = Flatten[Permutations[#] & /@ liste, 1]; @@ -5335,7 +5500,7 @@ as described in Meinhardt (2013). CddGmpPlotLowerSet[args___]:=(Message[CddGmpPlotLowerSet::argerr];$Failed); CddGmpPlotLowerSet[game_,opts:OptionsPattern[CddGmpPlotLowerSet]] := - Module[{liste, zwmat, finmat, bvec, smc, extmat, m, d1, vert1, vertlist1, string1, linearity1, incidences1, sortlist,ecdlist1,eadlist1,icdlist1,iadlist1}, + Block[{liste, zwmat, finmat, bvec, smc, extmat, m, d1, vert1, vertlist1, string1, linearity1, incidences1, sortlist,ecdlist1,eadlist1,icdlist1,iadlist1}, liste = Table[If[i >= j, 1, 0], {i, Length[T]}, {j, Length[T]}]; zwmat = Flatten[Permutations[#] & /@ liste, 1]; finmat = -Append[Take[zwmat, Length[T]], Last[zwmat]]; @@ -5354,14 +5519,14 @@ as described in Meinhardt (2013). ]; BaryCenter[args___]:=(Message[BaryCenter::argerr];$Failed); -BaryCenter[game_]:=Module[{crv}, +BaryCenter[game_]:=Block[{crv}, crv=CddGmpVerticesCore[game]; - Apply[Plus,crv]/Length[crv] + Total[crv]/Length[crv] ]; AnimationKernelProperty2d[game_, opts:OptionsPattern[AnimationKernelProperty2d]] := - Module[{uppval,lowval,stpsize,detlow,manip}, + Block[{uppval,lowval,stpsize,detlow,manip}, uppval = OptionValue[UpperCritVal]; lowval = OptionValue[LowerCritVal]; stpsize = OptionValue[IncSize]; @@ -5376,7 +5541,7 @@ as described in Meinhardt (2013). StrongEpsCore2d[args___]:=(Message[StrongEpsCore2d::argerr];$Failed); StrongEpsCore2d[game_, opts:OptionsPattern[StrongEpsCore2d]] := - Module[{fs,lab,oldvls,epsval,epsvls,newgame,vertlist,vert,cvh,mv,vpts,lgd,origgame,gr1,gr2,gr2b,gr,grli}, + Block[{fs,lab,oldvls,epsval,epsvls,newgame,vertlist,vert,cvh,mv,vpts,lgd,origgame,gr1,gr2,gr2b,gr,grli}, fs = OptionValue[FigureSize]; epsval = OptionValue[EpsilonValue]; lab = OptionValue[Labeling]; @@ -5403,7 +5568,7 @@ as described in Meinhardt (2013). FilledCoreV6[args___]:=(Message[FilledCoreV6::argerr];$Failed); FilledCoreV6[game_, opts:OptionsPattern[FilledCoreV6]] := - Module[{dlg,fs,sil,prim,vertlist,impext,solv,vert,mv1,mv2,imp,clm,lgd1,lgd2,vpts,ipts,spts,redead,rg,impred,dltr,cvh,tric,crdli,trpts,gr0,gr0b,gr1,gr1b,gr2,gr3,grli,gr}, + Block[{dlg,fs,sil,prim,vertlist,impext,solv,vert,mv1,mv2,imp,clm,lgd1,lgd2,vpts,ipts,spts,redead,rg,impred,dltr,cvh,tric,crdli,trpts,gr0,gr0b,gr1,gr1b,gr2,gr3,grli,gr}, dlg = OptionValue[DisplayLegend]; fs = OptionValue[FigureSize]; sil = OptionValue[Silent]; @@ -5446,7 +5611,7 @@ as described in Meinhardt (2013). ]; PointSol[game_] := - Module[{kr,nc,shv,prk}, + Block[{kr,nc,shv,prk}, kr=Kernel[game]; nc=ModifiedNucleolus[game]; shv = ShapleyValue[game]; @@ -5461,14 +5626,14 @@ as described in Meinhardt (2013). Vec3DToSimplex[{x1_?NumberQ, x2_?NumberQ, x3_?NumberQ}] := - Module[{}, {(x2 - x1) Sqrt[3]/2, x3 - (x1 + x2)/2}]; + Block[{}, {(x2 - x1) Sqrt[3]/2, x3 - (x1 + x2)/2}]; (* Borrowed from https://stackoverflow.com/questions/3506982/projecting-points-from-4d-space-into-3d-space-in-mathematica *) Vec4DToSimplex[{x1_?NumberQ, x2_?NumberQ, x3_?NumberQ, x4_?NumberQ}] := - Module[{}, {x2 + 1/2 * (x3 + x4), Sqrt[3] * (x3/2 + x4/6), Sqrt[6] * x4/3}]; + Block[{}, {x2 + 1/2 * (x3 + x4), Sqrt[3] * (x3/2 + x4/6), Sqrt[6] * x4/3}]; (* End mathlink section *) @@ -5477,7 +5642,7 @@ as described in Meinhardt (2013). AdjustedWorthVectors[args___]:=(Message[AdjustedWorthVectors::argerr];$Failed); -AdjustedWorthVectors[game_, k_Integer] := Module[{permliste}, +AdjustedWorthVectors[game_, k_Integer] := Block[{permliste}, If[Depth[k]==1, permliste = Permutations[T]; Table[If[SubCall1[#, i, k], @@ -5498,7 +5663,7 @@ as described in Meinhardt (2013). SubCall1[permele_, player_, k_Integer] := permele[[player]] < k; SubCall2[permele_, player_, k_Integer] := permele[[player]] > k; -PDeltaI[list_, player_] := Module[{thresh, newlist, genlist = {}, retval}, +PDeltaI[list_, player_] := Block[{thresh, newlist, genlist = {}, retval}, thresh = list[[player]]; newlist = DeleteCases[list, list[[player]]]; retval = If[# < thresh, Append[genlist, #], {}] & /@ newlist; @@ -5506,12 +5671,12 @@ as described in Meinhardt (2013). If[Depth[pdel]==2,Union[pdel],Union[#] & /@ pdel] ]; -PlayerIJoin[list_, player_] := Module[{pl}, +PlayerIJoin[list_, player_] := Block[{pl}, pl=List[Sort[Flatten[Append[PDeltaI[list, player], player]]]]; If[Depth[pl]==2,Union[upl],Union[#] & /@ pl] ]; -DeltaJSet[list_, k_Integer] := Module[{genlist = {}, pos, retval}, +DeltaJSet[list_, k_Integer] := Block[{genlist = {}, pos, retval}, pos = Flatten[If[# > k, Append[genlist, #], {}] & /@ list]; retval = Sort[Flatten[Position[list, #] & /@ pos]]; If[Depth[retval]==2,Union[retval],Union[#] & /@ retval] @@ -5558,6 +5723,29 @@ as described in Meinhardt (2013). Gap[args___]:=(Message[Gap::argerr];$Failed); Gap[game_]:= (UpperSum[game,#] - v[#]) & /@ Coalitions; +(* Generalized Gap Function *) + +GenConcession[args___]:=(Message[GenConcession::argerr];$Failed); + +GenConcession[game_]:= Map[Min,Table[(GenUpperSum[game,#] - v[#]) & /@ W[i],{i,Length[T]}]]; + +GenUtopiaPayoff[game_, i_] := + v[T] - v[DeleteCases[T, i]] /; + Last[GenGap[game]] > 0 && GenGap[game][[i + 1]] >= 0; + +GenUpperPayoff[args___]:=(Message[GenUpperPayoff::argerr];$Failed); +GenUpperPayoff[i_]:= Max[(v[#] - v[DeleteCases[#,i]]) &/@ Coalitions]; + +GenUpperPayoff[game_, i_]:= Max[(v[#] - v[DeleteCases[#,i]]) &/@ Coalitions]; + +GenUpperSum[args___]:=(Message[GenUpperSum::argerr];$Failed); +GenUpperSum[game_, S_List]:= Plus @@ GenUpperPayoff /@ S; + +GenGap[args___]:=(Message[GenGap::argerr];$Failed); +GenGap[game_]:= (GenUpperSum[game,#] - v[#]) & /@ Coalitions; + +GenUpperVector[args___]:=(Message[UpperVector::argerr];$Failed); +GenUpperVector[game_]:= GenUpperPayoff[game,#] & /@ T; vkS[game_,S_List]:= UpperSum[game,S] - Take[Gap[game],-1]; @@ -5592,16 +5780,69 @@ as described in Meinhardt (2013). Disagreement[game_]:= UpperVector[game] - Concession[game]; -TauVal[game_]:= UpperVector[game] - (Extract[Gap[game],-1] Concession[game])/Apply[Plus,Concession[game]]; +TauVal[game_]:= UpperVector[game] - (Extract[Gap[game],-1] Concession[game])/Total[Concession[game]]; TauValue[args___]:=(Message[TauValue::argerr];$Failed); -TauValue[game_]:= If[Last[Gap[game]]==0,Tau[game],TauVal[game]]; +TauValue[game_]:= Which[Last[Gap[game]]==0,Tau[game], + Last[Gap[game]]>0,TauVal[game], + True,Print["Game is not quasi-balanced!"];{}]; Tau[game_]:= UpperVector[game]; +(* Chi-Value, it is a generalized Tau-Value. *) + +ChiVal[game_]:= Block[{sc}, + sc=Total[GenConcession[game]]; + If[SameQ[sc,0],Print["Game is not essential!"];{}, + GenUpperVector[game] - (Extract[GenGap[game],-1] GenConcession[game])/sc] + ]; + +ChiValue[args___]:=(Message[ChiValue::argerr];$Failed); + +ChiValue[game_]:= Which[Last[GenGap[game]]==0,Chi[game], + Last[GenGap[game]]>0,ChiVal[game], + True,Print["Game is not essential!"];{}]; + +ChiValue[game_]:= If[Last[GenGap[game]]==0,Chi[game],ChiVal[game]]; +Chi[game_]:= GenUpperVector[game]; + + +GatelyValue[args___]:=(Message[GatelyValue::argerr];$Failed); +GatelyValue[game_]:=Block[{dess,d,uv,vi}, + vi=v[{#}] & /@ T; + dess = v[T] - Total[vi]; + d=(Plus @@ UpperPayoff /@ T -v[T])/dess; + uv=UpperPayoff[#] & /@ T; + If[SameQ[EssentialQ[game],True], + If[d==1,{},(uv+d*vi)/(d+1)], + Print["Game is not essential, Gately Point does not exist!"];{}] + ]; + + + + (* section general k-convex functions ends *) +(* Some Proportional Division Rules *) +PDValue[args___]:=(Message[PDValue::argerr];$Failed); +PDValue[game_]:=Block[{vi,trQ}, + vi=v[{#}] & /@ T; + trQ=Apply[And, Greater[#, 0] & /@ vi]; + If[SameQ[trQ,True], + (vi/Total[vi])*v[T], + Print["Game is not individually positive! No PD-Value computed!"];{}] + ]; + +EPSDValue[args___]:=(Message[EPSDValue::argerr];$Failed); +EPSDValue[game_]:=Block[{vi,trQ}, + vi=v[{#}] & /@ T; + trQ=Apply[And, Greater[#, 0] & /@ vi]; + Svi=Total[vi]; + If[SameQ[trQ,True], + (1/Length[T])*Svi + (vi/Svi)*(v[T]-Svi), + Print["Game is not individually positive! No EPSD-Value computed!"];{}] + ]; (* section miscellaneously functions starts *) @@ -5612,12 +5853,12 @@ as described in Meinhardt (2013). Print["Warning: Game is not convex!"]; {}]; -DuttaRayMain[game_,opts:OptionsPattern[DuttaRay]] := Module[{dp,rap,vrs, vN, objf, cr, prob, sol}, +DuttaRayMain[game_,opts:OptionsPattern[DuttaRay]] := Block[{dp,rap,vrs, vN, objf, cr, prob, sol}, dp=OptionValue[DigitPrecision]; rap=OptionValue[RationalApproximate]; vrs = x[#] & /@ T; vN = Table[v[T]/Length[T], {i, 1, Length[T]}]; - objf = Apply[Plus, MapThread[Subtract, {vrs, vN}]^2]; + objf = Total[MapThread[Subtract, {vrs, vN}]^2]; cr = Core[game]; prob = Prepend[cr, objf]; sol = NMinimize[prob, vrs,WorkingPrecision -> dp]; @@ -5627,12 +5868,12 @@ as described in Meinhardt (2013). LorenzSolution[args___]:=(Message[LorenzSolution::argerr];$Failed); -LorenzSolution[game_,opts:OptionsPattern[LorenzSolution]] := Module[{dp,rap,vrs, vN, objf, cr, prob, sol}, +LorenzSolution[game_,opts:OptionsPattern[LorenzSolution]] := Block[{dp,rap,vrs, vN, objf, cr, prob, sol}, dp=OptionValue[DigitPrecision]; rap=OptionValue[RationalApproximate]; vrs = x[#] & /@ T; vN = Table[v[T]/Length[T], {i, 1, Length[T]}]; - objf = Apply[Plus, MapThread[Subtract, {vrs, vN}]^2]; + objf = Total[MapThread[Subtract, {vrs, vN}]^2]; cr = If[CoreQ[game],Core[game],{};Break[]]; prob = Prepend[cr, objf]; sol = NMinimize[prob, vrs,WorkingPrecision -> dp]; @@ -5641,26 +5882,26 @@ as described in Meinhardt (2013). ]; MargValue[args___]:=(Message[MargValue::argerr];$Failed); -MargValue[game_]:=Module[{perm,list}, +MargValue[game_]:=Block[{perm,list}, list = T; perm = Permutations[list]; MapThread[Subtract,{Map[v,pred[#]],Map[v,mengen[#]]}] & /@ perm ]; -pred[list_]:= Module[{post,vorg,ober}, +pred[list_]:= Block[{post,vorg,ober}, post = Flatten[Flatten[Position[list,#]] & /@ T]; vorg = Take[list,post[[#]]-1] & /@ T; Sort[Extract[FlattenAt[MapThread[List,{vorg,T}],{#,1}],#]] & /@ T ]; -mengen[list_]:= Module[{post}, +mengen[list_]:= Block[{post}, post = Flatten[Flatten[Position[list,#]] & /@ T]; Sort[Take[list,post[[#]]-1]] & /@ T ]; CoreElementsQ[args___]:=(Message[CoreElementsQ::argerr];$Failed); -CoreElementsQ[game_,payoffs_List]:= Module[{}, +CoreElementsQ[game_,payoffs_List]:= Block[{}, Which[Depth[payoffs] == 3, InCoreQ[#,game] & /@ payoffs, Depth[payoffs] == 2, InCoreQ[payoffs,game], True, DisplayUsageRem[payoffs] @@ -5679,7 +5920,7 @@ as described in Meinhardt (2013). *) BalancedInequalityQ[args___]:=(Message[BalancedInequalityQ::argerr];$Failed); -BalancedInequalityQ[game_, coll_List] := Module[{bcQ, vS, cf, inQ}, +BalancedInequalityQ[game_, coll_List] := Block[{bcQ, vS, cf, inQ}, {bcQ, cf} = BalancedSystemQ[coll, T]; vS = v[#] & /@ coll; inQ = If[SameQ[bcQ, True], LessEqual[vS.cf, v[T]], @@ -5693,7 +5934,7 @@ as described in Meinhardt (2013). *) BelongToCoreQ[args___]:=(Message[BelongToCoreQ::argerr];$Failed); -BelongToCoreQ[game_, payoffs_List] := Module[{}, +BelongToCoreQ[game_, payoffs_List] := Block[{}, Which[Depth[payoffs] == 3, PayList[game, payoffs], Depth[payoffs] == 2, PaySole[game, payoffs], True,DisplayUsageRem[payoffs] @@ -5708,7 +5949,7 @@ as described in Meinhardt (2013). PayList[game_, list_] := - Module[{totsumS, imp, assalloc, ducoal, ins, trueli, wahrQ}, + Block[{totsumS, imp, assalloc, ducoal, ins, trueli, wahrQ}, totsumS := x[#] & /@ Coalitions; imp = x[#] & /@ T; assalloc = MapThread[Rule, {imp, #}] & /@ list; @@ -5722,7 +5963,7 @@ as described in Meinhardt (2013). PaySole[game_, payoff_] := - Module[{totsumS, imp, assalloc, ducoal, ins, trueli, wahrQ}, + Block[{totsumS, imp, assalloc, ducoal, ins, trueli, wahrQ}, totsumS := x[#] & /@ Coalitions; imp = x[#] & /@ T; assalloc = MapThread[Rule, {imp, payoff}]; @@ -5736,41 +5977,41 @@ as described in Meinhardt (2013). exzess:=(v[#]-x[#])& /@ Coalitions; GameBasis[args___]:=(Message[GameBasis::argerr];$Failed); -GameBasis[T_] := Module[{mgsys,gb}, +GameBasis[T_] := Block[{mgsys,gb}, mgsys = Drop[Subsets[T], 1]; gb = Table[If[SubSetQ[mgsys[[i]], #], 1, 0] & /@ mgsys, {i, Length[mgsys]}]; Transpose[gb] ]; CharacteristicValues[args___]:=(Message[CharacteristicValues::argerr];$Failed); -CharacteristicValues[coord_List,T_,opts:OptionsPattern[]]:= Module[{}, +CharacteristicValues[coord_List,T_,opts:OptionsPattern[]]:= Block[{}, Which[ Length[coord] === 2^Length[T] , DetWorth[coord,T] , True, WrongCoordDimension[coord, T]] ]; -DetWorth[coord_List, T_, opts:OptionsPattern[]]:=Module[{tugb, cval}, - tugb = GameBasis[T]; - cval = tugb.Drop[coord,1]; +DetWorth[coord_List, T_, opts:OptionsPattern[]]:=Block[{tugb, cval}, + tugb = GameBasis[T] //N; + cval = tugb.N[Drop[coord,1]]; Prepend[cval,0] ]; CoordS[args___]:=(Message[CoordS::argerr];$Failed); -CoordS[game_,S_List]:=Module[{liste,upper,iterat,mult,koeffient,value}, +CoordS[game_,S_List]:=Block[{liste,upper,iterat,mult,koeffient,value}, liste=(Length[#])& /@ Subsets[S]; upper=Table[Length[S],{Length[liste]}]; iterat=MapThread[Subtract,{upper,liste}]; mult= Table[-1,{Length[liste]}]; koeffient=MapThread[Power,{mult,iterat}]; value=(v[#])& /@ Subsets[S]; - Apply[Plus,MapThread[Times,{koeffient,value}]] + Total[MapThread[Times,{koeffient,value}]] ]; UnanimityCoordinates[args___]:=(Message[UnanimityCoordinates::argerr];$Failed); UnanimityCoordinates[game_]:=(CoordS[game,#])& /@ Coalitions; HarsanyiDividends[args___]:=(Message[HarsanyiDividends::argerr];$Failed); -HarsanyiDividends[game_]:=Module[{gb,valvec,unc}, +HarsanyiDividends[game_]:=Block[{gb,valvec,unc}, gb = GameBasis[T]; valvec = v[#] &/@ Subsets[T]; unc = Inverse[gb].Drop[valvec,1]; @@ -5778,7 +6019,7 @@ as described in Meinhardt (2013). ]; UnanConvexQ[args___]:=(Message[UnanConvexQ::argerr];$Failed); -UnanConvexQ[coord_List,T_,opts:OptionsPattern[UnanConvexQ]]:=Module[{}, +UnanConvexQ[coord_List,T_,opts:OptionsPattern[UnanConvexQ]]:=Block[{}, Which[Length[coord] != 2^Length[T] , WrongCoordDimension[coord, T];, UnanSize2NonNegQ[coord,T] === True, UnanConvexIffCondQ[coord,T,opts], True, Print["Game is not convex!"]; @@ -5790,7 +6031,7 @@ as described in Meinhardt (2013). UnanConvexIffCondQ[coord_List, T_, opts:OptionsPattern[UnanConvexQ]] := - Module[{dispres, discrd, npr,plpairs, ineq, lam, rlcrd, nneg,pwsets,rtnneg,trq, trfl}, + Block[{dispres, discrd, npr,plpairs, ineq, lam, rlcrd, nneg,pwsets,rtnneg,trq, trfl}, dispres = OptionValue[DisplayAllResults]; discrd = OptionValue[DisplayCoord]; npr = OptionValue[NumericalPrec]; @@ -5810,32 +6051,32 @@ as described in Meinhardt (2013). ]; -DetInEq[spij_List, T_] := Module[{pwset}, +DetInEq[spij_List, T_] := Block[{pwset}, pwset = Subsets[T]; DeleteCases[InEqCond[spij, #] & /@ pwset, 0] ]; InEqCond[splij_List, submg_List] := - Module[{mgsys, incij, trps, extset, uncoord}, + Block[{mgsys, incij, trps, extset, uncoord}, mgsys = DeleteCases[DeleteCases[Subsets[submg], {_}], {}]; incij = SubSetQ[splij, #] & /@ mgsys; trps = Position[incij, True]; extset = Extract[mgsys, trps]; uncoord = \[Lambda][#] & /@ extset; - Apply[Plus, uncoord] + Total[uncoord] ]; (* See Solano and Rafels, 1996 *) UnanAvConvexQ[args___]:=(Message[UnanAvConvexQ::argerr];$Failed); -UnanAvConvexQ[coord_List,T_,opts:OptionsPattern[UnanAvConvexQ]]:=Module[{}, +UnanAvConvexQ[coord_List,T_,opts:OptionsPattern[UnanAvConvexQ]]:=Block[{}, Which[Length[coord] != 2^Length[T] , WrongCoordDimension[coord, T];, True, UnanAvConvexIffCondQ[coord,T,opts] ] ]; -UnanSize2NonNegQ[coord_List,T_]:=Module[{no,tkno}, +UnanSize2NonNegQ[coord_List,T_]:=Block[{no,tkno}, no = Length[T] + 1 + Binomial[Length[T],2]; tkno = Take[coord,no]; Union[NonNegative[tkno]] === {True} @@ -5843,7 +6084,7 @@ as described in Meinhardt (2013). UnanAvConvexIffCondQ[coord_List, T_, opts:OptionsPattern[UnanAvConvexQ]] := - Module[{dispres, discrd, npr, pwsets, setsgr2, nneg,rtnneg, trq,trfl}, + Block[{dispres, discrd, npr, pwsets, setsgr2, nneg,rtnneg, trq,trfl}, dispres = OptionValue[DisplayAllResults]; discrd = OptionValue[DisplayCoord]; npr = OptionValue[NumericalPrec]; @@ -5860,7 +6101,7 @@ as described in Meinhardt (2013). UnanInEquality[coal_List, coord_List] := - Module[{Sc,obmg,sysob,sysin,pos,pos2,extc,intc,lgtc,inlam,mltun,addcrd,lam,rlcrd}, + Block[{Sc,obmg,sysob,sysin,pos,pos2,extc,intc,lgtc,inlam,mltun,addcrd,lam,rlcrd}, Sc = Complement[T,coal]; obmg = Drop[OberMenge[coal,T],1]; sysob = Subsets[#] & /@ obmg; @@ -5872,7 +6113,7 @@ as described in Meinhardt (2013). lgtc = Map[Length[#] &, #] & /@ intc; inlam = Map[Global`\[Lambda][#] &,#] & /@ extc; mltun = Table[MapThread[Times, {lgtc[[i]], inlam[[i]]}], {i, Length[inlam]}]; - addcrd = Apply[Plus, #] & /@ mltun; + addcrd = Total[#] & /@ mltun; lam = Global`\[Lambda][#] & /@ Subsets[T]; rlcrd = MapThread[Rule, {lam, coord}]; (# /. rlcrd) & /@ addcrd @@ -5883,7 +6124,7 @@ as described in Meinhardt (2013). (* See Meinhardt, 2009 *) DetQuasiAvConvex[args___]:=(Message[DetQuasiAvConvex::argerr];$Failed); DetQuasiAvConvex[game_]:= -Module[{uncrd, lnsi2, lnT, anfpt, endpt, tkcd, avccrd}, +Block[{uncrd, lnsi2, lnT, anfpt, endpt, tkcd, avccrd}, uncrd = HarsanyiDividends[game]; lnsi2 = Binomial[Length[T], 2]; lnT = Length[T]; @@ -5896,7 +6137,7 @@ as described in Meinhardt (2013). DetUCoord[args___]:=(Message[DetUCoord::argerr];$Failed); DetUCoord[coord_List,T_]:= - Module[{}, + Block[{}, Which[{Binomial[Length[T],2]} != Dimensions[coord], WrongCoordDimension[T];, Union[NonNegative[coord]] === {True}, AvCcoord[coord,T] , True, Print["Input error! \n Negative values are not allowed!"]; @@ -5904,7 +6145,7 @@ as described in Meinhardt (2013). ]; AvCcoord[coord_List, T_] := - Module[{uncrd, pwsts, setsgr2, mincrd, zvec, apz}, + Block[{uncrd, pwsts, setsgr2, mincrd, zvec, apz}, uncrd = coord; pwsts = Subsets[T]; setsgr2 = DeleteCases[If[Length[#] >= 3, #, {}] & /@ pwsts, {}]; @@ -5924,12 +6165,12 @@ as described in Meinhardt (2013). MinCoordLarger2[coord_List, setsgr2_, T_] := - Module[{plp, plpsets, plpsys, pos, crdsys, lamsys, crdeq2, rlcdr, inscrd}, + Block[{plp, plpsets, plpsys, pos, crdsys, lamsys, crdeq2, rlcdr, inscrd}, plp = PlayerPairs[setsgr2]; pos = Map[Position[plp, #] &, setsgr2]; plpsets = Map[Extract[plp, First[#]] &, #] & /@ pos; crdsys = Map[\[Lambda][#] &, #] & /@ plpsets; - lamsys = ((Apply[Plus, #])/Length[#]-1) & /@ crdsys; + lamsys = ((Total[#])/Length[#]-1) & /@ crdsys; crdeq2 = \[Lambda][#] & /@ PlayerPairs[T]; rlcdr = MapThread[Rule, {crdeq2, coord}]; inscrd = lamsys /. rlcdr; @@ -5938,26 +6179,26 @@ as described in Meinhardt (2013). MinUnanimityCoordinates[args___]:=(Message[MinUnanimityCoordinates::argerr];$Failed); -MinUnanimityCoordinates[game_]:=Module[{anz,sepset}, +MinUnanimityCoordinates[game_]:=Block[{anz,sepset}, anz=(Length[#])& /@ Subsets[T]; sepset=Extract[Subsets[T],Position[anz,#]] & /@ T; Table[Min[(CoordS[game,#])& /@ sepset[[i]]],{i,1,Length[T]}] ]; StrictlyConvexUnanConditionQ[args___]:=(Message[StrictlyConvexUnanConditionQ::argerr];$Failed); -StrictlyConvexUnanConditionQ[game_]:= Module[{unanc}, +StrictlyConvexUnanConditionQ[game_]:= Block[{unanc}, unanc=EvalSumMinCoord[game]; Apply[And,Positive[unanc]] ]; ConvexUnanConditionQ[args___]:=(Message[ConvexUnanConditionQ::argerr];$Failed); -ConvexUnanConditionQ[game_]:= Module[{unanc}, +ConvexUnanConditionQ[game_]:= Block[{unanc}, unanc=EvalSumMinCoord[game]; Apply[And,NonNegative[unanc]] ]; -ConvexUnanIffCoord[game_] :=Module[{pij, dems, tog, lams, unc}, +ConvexUnanIffCoord[game_] :=Block[{pij, dems, tog, lams, unc}, pij = Table[If[i >= j, {}, {i, j}], {i, Length[T]}, {j, Length[T]}]; dems = DeleteCases[DeleteCases[#, {}] & /@ pij, {}]; tog = Apply[Join, dems]; @@ -5971,7 +6212,7 @@ as described in Meinhardt (2013). EvalSumMinCoord[args___]:=(Message[EvalSumMinCoord::argerr];$Failed); EvalSumMinCoord[game_]:= - Module[{smallestcoord,alphak,post,rg,firstneg,s0,restmin,alltrueQ,fac,retval,singleQ}, + Block[{smallestcoord,alphak,post,rg,firstneg,s0,restmin,alltrueQ,fac,retval,singleQ}, smallestcoord=MinUnanimityCoordinates[game]; alphak=Drop[smallestcoord,1]; post=NonNegative[#]&/@ alphak; @@ -5985,7 +6226,7 @@ as described in Meinhardt (2013). rg=Range[Length[alphak]]; restmin=Take[alphak,#] & /@ rg; fac=Table[Table[(k!)/((j!)(k-j)!),{j,0,k}],{k,0,Length[T]-2}]; - Apply[Plus,#] & /@ MapThread[Times,{fac,restmin}] + Total[#] & /@ MapThread[Times,{fac,restmin}] ], singleQ=NonNegative[Take[smallestcoord,1]]; alltrueQ=Apply[And,{alltrueQ,singleQ}][[1]]; diff --git a/TuGamesAux.nb b/TuGamesAux.nb index 5eab8d7..c982c42 100644 --- a/TuGamesAux.nb +++ b/TuGamesAux.nb @@ -3,17 +3,17 @@ (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) -(* CreatedBy='Mathematica 11.3' *) +(* CreatedBy='Mathematica 12.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] -NotebookDataLength[ 130226, 3347] -NotebookOptionsPosition[ 126858, 3302] -NotebookOutlinePosition[ 127193, 3317] -CellTagsIndexPosition[ 127150, 3314] +NotebookDataLength[ 130171, 3343] +NotebookOptionsPosition[ 126745, 3297] +NotebookOutlinePosition[ 127137, 3313] +CellTagsIndexPosition[ 127094, 3310] WindowFrame->Normal*) (* Beginning of Notebook Content *) @@ -26,10 +26,10 @@ Cell[BoxData[ RowBox[{"(*", " ", RowBox[{"Release", " ", RowBox[{"Date", ":", " ", - RowBox[{"31.05", ".2019"}]}]}], " ", "*)"}], "\n", + RowBox[{"22.04", ".2020"}]}]}], " ", "*)"}], "\n", RowBox[{"(*", " ", RowBox[{"Version", ":", " ", - RowBox[{"2.5", ".4"}]}], " ", "*)"}], "\n", "\n", + RowBox[{"2.6", ".0"}]}], " ", "*)"}], "\n", "\n", RowBox[{"(*", " ", RowBox[{":", "Context", ":", " ", "TuGamesAux`"}], " ", "*)"}], "\n", "\n", RowBox[{"(*", " ", @@ -55,7 +55,7 @@ Cell[BoxData[ RowBox[{"(*", " ", RowBox[{":", RowBox[{"Package", " ", "Version"}], ":", " ", - RowBox[{"2.5", ".4"}]}], " ", "*)"}], "\n", "\n", + RowBox[{"2.6", ".0"}]}], " ", "*)"}], "\n", "\n", RowBox[{"(*", " ", "\n", " ", RowBox[{ RowBox[{":", @@ -199,14 +199,18 @@ Cell[BoxData[ RowBox[{"use", " ", "it", " ", "with", " ", "care"}], ",", " ", RowBox[{ RowBox[{"it", " ", "returns", " ", "for", " ", "n"}], "=", - RowBox[{">", - RowBox[{ - "4", " ", "incorrect", " ", "results", " ", "probably", " ", "due", " ", - "to", " ", "\n", " ", "a", " ", "bug", " ", "within", " ", - "the", " ", - RowBox[{"DualLinearProgramming", ".", " ", "For"}], " ", "an", " ", - "example", " ", "see", " ", - RowBox[{"ChangeLog", "."}]}]}]}]}], "\n", "\n", "*)"}], "\n", "\n", + RowBox[{ + RowBox[{">", + RowBox[{ + "4", " ", "incorrect", " ", "results", " ", "probably", " ", "due", + " ", "to", " ", "\n", " ", "a", " ", "bug", " ", "within", " ", + "the", " ", + RowBox[{"DualLinearProgramming", ".", " ", "For"}], " ", "an", " ", + "example", " ", "see", " ", + RowBox[{"ChangeLog", ".", "\n", "\n", "\n", " ", "Version"}], " ", + "2.6", ".0"}]}], ":", "\n", " ", + RowBox[{"Performing", " ", "some", " ", "code", " ", + RowBox[{"maintenance", "."}]}]}]}]}], "\n", "*)"}], "\n", "\n", RowBox[{ RowBox[{ RowBox[{"BeginPackage", "[", "\"\\"", "]"}], ";"}], @@ -341,7 +345,7 @@ ring.\>\""}], ";"}], "\n", "\n", RowBox[{ RowBox[{ RowBox[{"LieBracket", "::", "usage"}], " ", "=", " ", "\n", - "\"\\""}], ";"}], "\n", "\n", RowBox[{ RowBox[{ @@ -441,7 +445,7 @@ the second kind.\>\""}], ";"}], "\n", "\n", RowBox[{ RowBox[{"TalmudicRule", "::", "argerr"}], "=", "\"\\""}], ";"}]}]}]], "Code",ExpressionUU\ -ID->"f757bbc1-1b29-4879-bb07-be6f491c11ad"], +ID->"55071896-7dee-478b-af1a-901f0294a220"], Cell[BoxData[ RowBox[{ @@ -489,7 +493,7 @@ Cell[BoxData[ RowBox[{ RowBox[{"SymGameType4", "::", "argerr"}], "=", "\"\\""}], ";"}]}]}]], "Code",Expression\ -UUID->"e2f8c995-4a1f-456f-8be3-1ca19d004dfa"], +UUID->"a547e0cf-dec2-485a-83fa-f1bc9a7ba83b"], Cell[BoxData[{ RowBox[{ @@ -508,7 +512,7 @@ Cell[BoxData[{ RowBox[{"Needs", "[", "\"\\"", "]"}], ",", "\n", " ", "True", ",", " ", RowBox[{"Needs", "[", "\"\\"", "]"}]}], "\n", "]"}], - ";"}]}], "Code",ExpressionUUID->"2866b051-5abb-47b6-9521-2debab9eff1f"], + ";"}]}], "Code",ExpressionUUID->"b3e8b0f2-b3b8-4e7e-981c-47ba78c1e630"], Cell[BoxData[{ RowBox[{ @@ -759,8 +763,8 @@ Cell[BoxData[{ RowBox[{"ar", ",", "rl"}], "]"}]}], ";", "\n", " ", RowBox[{"{", RowBox[{"zf", ",", " ", "coemat", ",", " ", "bvec"}], "}"}]}]}], "\n", - " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"355359a7-1c30-4a5f-8256-\ -8646bd52059c"], + " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"fa2c7bd5-b9fb-40e1-b6de-\ +0cd0666964a6"], Cell[BoxData[{ RowBox[{ @@ -775,7 +779,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"SolvePrimal", "[", RowBox[{"zf_", ",", "eq_List", ",", "var_List", ",", " ", - RowBox[{"bd_:", + RowBox[{"bd_", ":", RowBox[{"{", "}"}]}], ",", " ", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "LinearProgramming", "]"}]}]}], "]"}], @@ -812,8 +816,8 @@ Cell[BoxData[{ RowBox[{"Prepend", "[", RowBox[{ RowBox[{"{", "rl", "}"}], ",", " ", "nzf"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"fed8d680-89e3-42dd-add0-\ -e28a12e60e98"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"e7f15e4e-73ad-4479-b5d4-\ +a386f1577606"], Cell[BoxData[{ RowBox[{ @@ -828,7 +832,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{"SolveDual", "[", RowBox[{"zf_", ",", " ", "eq_List", ",", " ", "var_List", ",", " ", - RowBox[{"bd_:", + RowBox[{"bd_", ":", RowBox[{"{", "}"}]}], ",", RowBox[{"opts", ":", RowBox[{"OptionsPattern", "[", "LinearProgramming", "]"}]}]}], "]"}], ":=", @@ -896,8 +900,8 @@ Cell[BoxData[{ RowBox[{"Prepend", "[", RowBox[{ RowBox[{"{", "rl", "}"}], ",", " ", "nzf"}], "]"}]}]}], "\n", " ", - "]"}]}], ";"}]}], "Code",ExpressionUUID->"7ecb8202-4d40-4be9-b2bf-\ -c37d0aaf9884"], + "]"}]}], ";"}]}], "Code",ExpressionUUID->"3f5b4305-3e1a-4ef6-b101-\ +0bd813e77766"], Cell[BoxData[ RowBox[{ @@ -941,7 +945,7 @@ Cell[BoxData[ RowBox[{"DisplayMessNearRing", "[", "set", "]"}]}], "]"}]}], ";", "\n", " ", RowBox[{"Return", "[", "boolval", "]"}]}]}], "\n", " ", "]"}]}], - ";"}]}]}]], "Code",ExpressionUUID->"bab3aea4-9fa5-4f72-a072-094cb8f9e04e"], + ";"}]}]}]], "Code",ExpressionUUID->"20b11a04-6c4d-4464-8bf5-abe3953f7eb1"], Cell[BoxData[ RowBox[{ @@ -949,7 +953,7 @@ Cell[BoxData[ RowBox[{"CheckNearRing", "[", RowBox[{ "Univers_List", ",", " ", "RestSet_List", ",", " ", "T2_", ",", " ", - RowBox[{"prevres_:", + RowBox[{"prevres_", ":", RowBox[{"{", "}"}]}]}], "]"}], " ", ":=", " ", "\n", " ", RowBox[{"Module", "[", RowBox[{ @@ -992,7 +996,7 @@ Cell[BoxData[ RowBox[{ "Univers", ",", " ", "restuni", ",", " ", "T2", ",", " ", "allres"}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}]], "Code",Expression\ -UUID->"179795fe-1aba-45f3-adce-d3344b32a16b"], +UUID->"e7ef70c8-5634-4e95-9336-d0b22aa64202"], Cell[BoxData[ RowBox[{ @@ -1030,7 +1034,7 @@ Cell[BoxData[ RowBox[{"Intersection", "[", RowBox[{"A", ",", " ", "B"}], "]"}]}], "]"}], "]"}], " ", "!=", " ", "0"}]}], ")"}]}]}], "\n", " ", "\n", " ", "]"}]}], - ";"}]], "Code",ExpressionUUID->"45cd2524-d16f-4c6a-92c8-e650c35a9e14"], + ";"}]], "Code",ExpressionUUID->"ccc64bfc-b63b-4a63-9de2-3f362a58d379"], Cell[BoxData[ RowBox[{ @@ -1045,7 +1049,7 @@ Cell[BoxData[ "Print", "[", "\"\\"", "]"}], ";", "\n", " ", RowBox[{"Print", "[", "\"\\"", "]"}]}], ")"}]}], - ";"}]], "Code",ExpressionUUID->"57324b1c-fb4b-4de4-8f23-bb7dd1ff57fc"], + ";"}]], "Code",ExpressionUUID->"565a83cb-5452-437e-b254-ac09806c2f90"], Cell[BoxData[ RowBox[{ @@ -1108,7 +1112,7 @@ Cell[BoxData[ RowBox[{"OptionValue", "[", "MarketParameter", "]"}]}], ";", " ", "\n", " ", RowBox[{"coal", " ", "=", " ", - RowBox[{"teilm", "[", "T", "]"}]}], ";", "\n", " ", + RowBox[{"Subsets", "[", "T", "]"}]}], ";", "\n", " ", RowBox[{"val", " ", "=", " ", RowBox[{ RowBox[{ @@ -1163,11 +1167,8 @@ Cell[BoxData[ RowBox[{"x", " ", "/@", " ", "T"}], ",", "claims"}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"compset", " ", "=", " ", - RowBox[{ - RowBox[{ - RowBox[{"Complement", "[", - RowBox[{"T", ",", "#"}], "]"}], " ", "&"}], "/@", " ", - RowBox[{"teilm", "[", "T", "]"}]}]}], ";", "\n", " ", + RowBox[{"Reverse", "[", + RowBox[{"Subsets", "[", "T", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"vecval", " ", "=", " ", RowBox[{ RowBox[{ @@ -1214,7 +1215,7 @@ Cell[BoxData[ RowBox[{"Min", "[", RowBox[{"E", ",", " ", RowBox[{"x", "[", "#", "]"}]}], "]"}], " ", "&"}], "/@", " ", - RowBox[{"teilm", "[", "T", "]"}]}]}], ";", "\n", " ", + RowBox[{"Subsets", "[", "T", "]"}]}]}], ";", "\n", " ", RowBox[{"vecval", " ", "/.", "asscl"}]}]}], "\n", "]"}]}], ";"}], "\n", "\n", RowBox[{ @@ -1308,7 +1309,7 @@ Problem.\>\"", "]"}], ";", "\n", " ", RowBox[{ "\"\\"", ",", " ", "\"\<{d1,d2}\>\""}], "]"}], ";"}], ")"}]}], ";"}]}]}]], "Code",E\ -xpressionUUID->"b5202f7c-8fba-4070-ac9e-6b7e58261087"], +xpressionUUID->"36055042-66c3-45ae-b165-e451499ec368"], Cell[BoxData[{ RowBox[{ @@ -1342,8 +1343,7 @@ Cell[BoxData[{ RowBox[{"Length", "[", "Claims", "]"}], "]"}]}], "]"}]}], ";", "\n", " ", RowBox[{"sumcl", " ", "=", " ", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "clvar"}], "]"}]}], ";", "\n", " ", + RowBox[{"Total", "[", " ", "clvar", "]"}]}], ";", "\n", " ", RowBox[{"param", " ", "=", " ", RowBox[{"MapThread", "[", RowBox[{"Rule", ",", " ", @@ -1383,8 +1383,7 @@ Cell[BoxData[{ RowBox[{"Reduce", "[", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "eqsys"}], "]"}], " ", "==", " ", + RowBox[{"Total", "[", " ", "eqsys", "]"}], " ", "==", " ", "Estate"}], ",", " ", "\[Lambda]"}], "]"}]}], ";", "\n", " ", RowBox[{"sol01", " ", "=", " ", RowBox[{"MapThread", "[", @@ -1397,7 +1396,7 @@ Cell[BoxData[{ RowBox[{"[", "2", "]"}], "]"}], "}"}]}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"eqsys", " ", "/.", " ", "sol01"}]}]}], "\n", " ", "]"}]}], - ";"}]}], "Code",ExpressionUUID->"9bc8f56e-5c46-4faf-af37-b346a1726ff4"], + ";"}]}], "Code",ExpressionUUID->"9f2abd4d-22d0-41db-ba30-96b4943bbf4e"], Cell[BoxData[ RowBox[{ @@ -1493,7 +1492,7 @@ dimension: \>\"", ",", " ", RowBox[{"First", "[", RowBox[{"Dimensions", "[", "valOfsellers", "]"}], "]"}]}], " ", "]"}], ";"}]}], "\n", " ", "]"}]}], "\n", " ", "]"}]}], ";"}], - "\n"}]}]], "Code",ExpressionUUID->"6d438fae-c371-41d5-bddc-6df6a0742f77"], + "\n"}]}]], "Code",ExpressionUUID->"436a5f9a-9da5-422c-89ee-8993a5334c87"], Cell[BoxData[{ RowBox[{ @@ -1659,7 +1658,7 @@ problem into a symmetric one. \>\"", "]"}]}], ";"}], "\n"}], "\n", RowBox[{"{", RowBox[{"buyers", ",", " ", "sellers"}], "}"}]}], "\n", " ", "]"}]}], "\n", " ", "]"}]}], ";"}]}], "Code",Expressi\ -onUUID->"5701ad12-7ea7-4ef3-be99-d864c764461d"], +onUUID->"58f3e48b-574a-4258-b8ff-47dc0c3df925"], Cell[BoxData[{ RowBox[{ @@ -1758,8 +1757,8 @@ Cell[BoxData[{ RowBox[{"Append", "[", RowBox[{"profmat", ",", " ", "zromat"}], "]"}], ",", " ", RowBox[{"-", "1"}]}], "]"}]}], ";", "\n", " ", "nwmat"}]}], "\n", - " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"1af4bb05-07d0-4e8e-9299-\ -86efa448b40f"], + " ", "]"}]}], ";"}]}], "Code",ExpressionUUID->"9771f749-0c07-42c6-ad4a-\ +0e4ebc5dabf1"], Cell[BoxData[{ RowBox[{ @@ -2076,7 +2075,7 @@ Cell[BoxData[{ RowBox[{"Reverse", "[", "#", "]"}], " ", "&"}], ",", "#"}], "]"}], " ", "&"}], " ", "/@", " ", "mptprs"}]}]}], " ", "]"}]}], "\n", " ", "]"}]}]}], "\n", " ", "]"}]}], ";"}]}], "Code",Expressi\ -onUUID->"9640c76e-0d7b-478a-b735-979a99796204"], +onUUID->"8b871bd9-8871-438b-9136-cc1a1b6df891"], Cell[BoxData[ RowBox[{ @@ -2106,8 +2105,8 @@ Cell[BoxData[ " ", RowBox[{"{", RowBox[{"extcob", ",", "extcos"}], "}"}]}]}], "\n", " ", - "\n", "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->"f62c975c-a9ed-\ -4630-b0ef-e0af5f7d21a5"], + "\n", "]"}]}], ";"}], "\n"}]], "Code",ExpressionUUID->"c15e087a-66ea-\ +4662-b709-2ed66e45522f"], Cell[BoxData[ RowBox[{ @@ -2204,7 +2203,7 @@ Cell[BoxData[ "\n", " ", RowBox[{"Apply", "[", RowBox[{"Join", ",", " ", "mptab"}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}]], "Code",ExpressionUUID->"11170734-cf87-4e66-bdb0-8701f06d6294"], + ";"}]], "Code",ExpressionUUID->"74eef9e5-a241-4484-b35e-fbe66e11f030"], Cell[BoxData[{ RowBox[{ @@ -2323,9 +2322,8 @@ Cell[BoxData[{ RowBox[{"Depth", "[", "matchli", "]"}], " ", "<=", " ", "3"}], ",", " ", RowBox[{"Max", "[", - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "profitli"}], "]"}], "]"}], ",", " ", - "\n", " ", + RowBox[{"Total", "[", " ", "profitli", "]"}], "]"}], ",", " ", "\n", + " ", RowBox[{ RowBox[{"Depth", "[", "matchli", "]"}], " ", "===", " ", "5"}], ",", " ", @@ -2334,8 +2332,7 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", + RowBox[{"Total", "[", " ", "#", "]"}], " ", "&"}], " ", "/@", " ", RowBox[{"profitli", "[", RowBox[{"[", "i", "]"}], "]"}]}], ",", " ", @@ -2346,10 +2343,9 @@ Cell[BoxData[{ RowBox[{"Max", "[", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", "#"}], "]"}], " ", "&"}], " ", "/@", - " ", "profitli"}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], - ";"}], "\n", "\n", + RowBox[{"Total", "[", " ", "#", "]"}], " ", "&"}], " ", "/@", " ", + "profitli"}], "]"}]}], "]"}]}]}], "\n", " ", "]"}]}], ";"}], + "\n", "\n", RowBox[{"(*", " ", RowBox[{ RowBox[{"Euclidean", " ", "Distance"}], ",", " ", @@ -2394,17 +2390,16 @@ Cell[BoxData[{ RowBox[{"N", "[", RowBox[{"Power", "[", RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", " ", - RowBox[{"MapThread", "[", + RowBox[{"Total", "[", " ", + RowBox[{"MapThread", "[", + RowBox[{ RowBox[{ - RowBox[{ - RowBox[{"Power", "[", - RowBox[{ - RowBox[{"#1", " ", "-", " ", "#2"}], ",", " ", "2"}], "]"}], - " ", "&"}], ",", " ", - RowBox[{"{", - RowBox[{"liste", ",", " ", "refliste"}], "}"}]}], "]"}]}], "]"}], + RowBox[{"Power", "[", + RowBox[{ + RowBox[{"#1", " ", "-", " ", "#2"}], ",", " ", "2"}], "]"}], " ", + "&"}], ",", " ", + RowBox[{"{", + RowBox[{"liste", ",", " ", "refliste"}], "}"}]}], "]"}], "]"}], ",", " ", RowBox[{"(", RowBox[{"1", "/", "2"}], ")"}]}], "]"}], "]"}]}], ";"}], "\n"}], "\n", @@ -2425,13 +2420,13 @@ Cell[BoxData[{ ";", "\n", " ", RowBox[{ "Print", "[", "\"\\"", "]"}]}], - "\n", ")"}]}], ";"}]}], "Code",ExpressionUUID->"46e07424-3f4e-4497-a97d-\ -a84240e97842"], + "\n", ")"}]}], ";"}]}], "Code",ExpressionUUID->"4a4e77d9-ae6d-43be-b221-\ +67da38249566"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{"Assigning", " ", "symmetric", " ", "values"}], " ", "*)"}]], "Code",\ -ExpressionUUID->"7c0c0d5c-544b-4e3b-9f5b-c274c2393706"], +ExpressionUUID->"ed05ec3d-0722-4612-accf-3e32a6ec9f0e"], Cell[BoxData[ RowBox[{ @@ -2483,7 +2478,7 @@ Cell[BoxData[ RowBox[{"First", "[", "univers", "]"}], "]"}], " ", "=", " ", "Global`\[Gamma]"}]}], "]"}], ",", " ", "True", ",", " ", "Global`\[Sigma]"}], "]"}]}], "]"}]}], "]"}]}], ";"}]], "Code",Expres\ -sionUUID->"830ff08e-e1e3-410f-b844-665eb58bcf34"], +sionUUID->"d3e35930-001c-4369-b90d-ff7fe7c45fff"], Cell[BoxData[{ RowBox[{ @@ -2520,10 +2515,9 @@ Cell[BoxData[{ " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "#"}], "]"}], "&"}], "/@", " ", "sxp"}]}]}], - "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"95d5432b-12c3-4272-96b3-\ -e7fdfe6383f1"], + RowBox[{"Total", "[", "#", "]"}], "&"}], "/@", " ", "sxp"}]}]}], "\n", + "]"}]}], ";"}]}], "Code",ExpressionUUID->"26ed7353-de54-42e8-a24d-\ +5648e3cbcdbd"], Cell[BoxData[{ RowBox[{ @@ -2553,10 +2547,9 @@ Cell[BoxData[{ " ", RowBox[{ RowBox[{ - RowBox[{"Apply", "[", - RowBox[{"Plus", ",", "#"}], "]"}], "&"}], "/@", " ", "sxp"}]}]}], - "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"15d3955c-147a-43c6-9a7c-\ -1010061a1c4d"], + RowBox[{"Total", "[", "#", "]"}], "&"}], "/@", " ", "sxp"}]}]}], "\n", + "]"}]}], ";"}]}], "Code",ExpressionUUID->"f2e0a0fb-009b-4704-a5ca-\ +2f8b69b574d3"], Cell[BoxData[ RowBox[{ @@ -2712,8 +2705,8 @@ Cell[BoxData[ RowBox[{ RowBox[{"Indeterminate", " ", "&"}], ",", " ", RowBox[{"Length", "[", "T", "]"}]}], "]"}]}], "}"}]}], - "]"}]}]}], "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"2df2dc6d-\ -1465-4827-9806-129440d54ee2"], + "]"}]}]}], "]"}]}], ";"}]}]}]], "Code",ExpressionUUID->"5899d05e-\ +52b7-4c7a-b43e-5cec9ddc8b41"], Cell[BoxData[{ RowBox[{ @@ -2804,8 +2797,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "sbs"}]}]}], - "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"7b79de5c-f878-4238-a38a-\ -63f1f4ab6d42"], + "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"c154546c-2368-42a7-a7fc-\ +8b8b5191c6ce"], Cell[BoxData[{ RowBox[{ @@ -2890,8 +2883,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "sbs"}]}]}], - "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"3f5e01e0-0a41-47e2-a517-\ -5064edaddb5f"], + "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"907291b5-6fec-4587-bd94-\ +3e0de42edb36"], Cell[BoxData[{ RowBox[{ @@ -2978,8 +2971,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "sbs"}]}]}], - "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"9d31ab9b-c014-4061-a6ac-\ -bd78f60bec7a"], + "\n", "]"}]}], ";"}]}], "Code",ExpressionUUID->"7c1a27aa-910b-41bc-a48f-\ +f40b211db256"], Cell[BoxData[{ RowBox[{ @@ -3068,8 +3061,8 @@ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"v", "[", "#", "]"}], " ", "&"}], " ", "/@", " ", "sbs"}]}]}], - "\n", "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"0c7dd938-3608-4026-\ -ab6a-abe65ccac0cc"], + "\n", "]"}]}], ";"}], "\n"}], "Code",ExpressionUUID->"4437937e-0c49-4762-\ +bb4e-1392d8a271aa"], Cell[BoxData[ RowBox[{ @@ -3103,8 +3096,8 @@ Cell[BoxData[ "]"}], ",", "\n", " ", "True", ",", " ", RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";"}]}], "\n", " ", - "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"cd29b031-9f14-\ -4e06-87b2-9822025a621d"], + "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"382763a7-b030-\ +4116-86c0-af048b1ebf92"], Cell[BoxData[ RowBox[{ @@ -3140,8 +3133,8 @@ Cell[BoxData[ ",", "0"}], "]"}], ",", "\n", " ", "True", ",", " ", RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";"}]}], "\n", " ", - "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"caad8ff2-08ab-\ -4344-a59f-c2730b24ef73"], + "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"63281a84-fdb6-\ +460e-89f8-f0a584461a54"], Cell[BoxData[ RowBox[{ @@ -3180,8 +3173,8 @@ Cell[BoxData[ " ", RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";"}]}], "\n", " ", - "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"b88a3d39-6677-\ -41af-af1f-fab5413b33ae"], + "]"}]}], "\n", "]"}]}], ";"}]], "Code",ExpressionUUID->"c90c1ef8-1408-\ +4a27-830f-5e4a7c97c601"], Cell[BoxData[ RowBox[{ @@ -3199,7 +3192,9 @@ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"LieBracket", "[", - RowBox[{"mat01_List", ",", "mat02_List"}], "]"}], ":=", " ", + RowBox[{ + RowBox[{"mat01_", "?", "ListQ"}], ",", + RowBox[{"mat02_", "?", "ListQ"}]}], "]"}], ":=", " ", RowBox[{ RowBox[{"mat01", ".", "mat02"}], " ", "-", " ", RowBox[{"mat02", ".", "mat01"}]}]}], ";"}], "\n", "\n", @@ -3295,15 +3290,16 @@ Cell[BoxData[ ";"}], "\n", "\n", RowBox[{ RowBox[{"End", "[", "]"}], ";"}], "\n"}]}]], "Code",ExpressionUUID->\ -"7fa8a0c2-0b8e-44d8-95c2-59236b6f9450"], +"d5f87e14-6ebe-40bb-a69b-7a28930f06f9"], Cell[BoxData[ - RowBox[{"EndPackage", "[", "]"}]], "Code",ExpressionUUID->"810b9125-fe28-40ac-a3aa-222bd540fd52"] + RowBox[{"EndPackage", "[", "]"}]], "Code",ExpressionUUID->"fed0e872-9f6e-4e7a-90c8-585e156f381f"] }, -WindowSize->{630, 827}, -WindowMargins->{{278, Automatic}, {Automatic, 82}}, -FrontEndVersion->"11.3 for Linux x86 (64-bit) (March 6, 2018)", -StyleDefinitions->"Default.nb" +WindowSize->{808, 869}, +WindowMargins->{{144, Automatic}, {91, Automatic}}, +FrontEndVersion->"12.1 for Linux x86 (64-bit) (March 18, 2020)", +StyleDefinitions->"Default.nb", +ExpressionUUID->"7ace5302-f9aa-4802-8898-8a29bcd4f716" ] (* End of Notebook Content *) @@ -3316,39 +3312,39 @@ CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ -Cell[558, 20, 18996, 423, 4915, "Code",ExpressionUUID->"f757bbc1-1b29-4879-bb07-be6f491c11ad"], -Cell[19557, 445, 1623, 46, 269, "Code",ExpressionUUID->"e2f8c995-4a1f-456f-8be3-1ca19d004dfa"], -Cell[21183, 493, 827, 17, 154, "Code",ExpressionUUID->"2866b051-5abb-47b6-9521-2debab9eff1f"], -Cell[22013, 512, 9489, 250, 936, "Code",ExpressionUUID->"355359a7-1c30-4a5f-8256-8646bd52059c"], -Cell[31505, 764, 1899, 51, 70, "Code",ExpressionUUID->"fed8d680-89e3-42dd-add0-e28a12e60e98"], -Cell[33407, 817, 3174, 82, 70, "Code",ExpressionUUID->"7ecb8202-4d40-4be9-b2bf-c37d0aaf9884"], -Cell[36584, 901, 1593, 42, 70, "Code",ExpressionUUID->"bab3aea4-9fa5-4f72-a072-094cb8f9e04e"], -Cell[38180, 945, 1935, 49, 70, "Code",ExpressionUUID->"179795fe-1aba-45f3-adce-d3344b32a16b"], -Cell[40118, 996, 1354, 36, 70, "Code",ExpressionUUID->"45cd2524-d16f-4c6a-92c8-e650c35a9e14"], -Cell[41475, 1034, 573, 13, 70, "Code",ExpressionUUID->"57324b1c-fb4b-4de4-8f23-bb7dd1ff57fc"], -Cell[42051, 1049, 9999, 261, 70, "Code",ExpressionUUID->"b5202f7c-8fba-4070-ac9e-6b7e58261087"], -Cell[52053, 1312, 3289, 87, 70, "Code",ExpressionUUID->"9bc8f56e-5c46-4faf-af37-b346a1726ff4"], -Cell[55345, 1401, 3761, 94, 70, "Code",ExpressionUUID->"6d438fae-c371-41d5-bddc-6df6a0742f77"], -Cell[59109, 1497, 6434, 164, 70, "Code",ExpressionUUID->"5701ad12-7ea7-4ef3-be99-d864c764461d"], -Cell[65546, 1663, 3681, 98, 70, "Code",ExpressionUUID->"1af4bb05-07d0-4e8e-9299-86efa448b40f"], -Cell[69230, 1763, 13345, 315, 70, "Code",ExpressionUUID->"9640c76e-0d7b-478a-b735-979a99796204"], -Cell[82578, 2080, 1057, 29, 70, "Code",ExpressionUUID->"f62c975c-a9ed-4630-b0ef-e0af5f7d21a5"], -Cell[83638, 2111, 3613, 95, 70, "Code",ExpressionUUID->"11170734-cf87-4e66-bdb0-8701f06d6294"], -Cell[87254, 2208, 8375, 220, 70, "Code",ExpressionUUID->"46e07424-3f4e-4497-a97d-a84240e97842"], -Cell[95632, 2430, 171, 3, 70, "Code",ExpressionUUID->"7c0c0d5c-544b-4e3b-9f5b-c274c2393706"], -Cell[95806, 2435, 2166, 50, 70, "Code",ExpressionUUID->"830ff08e-e1e3-410f-b844-665eb58bcf34"], -Cell[97975, 2487, 1274, 38, 70, "Code",ExpressionUUID->"95d5432b-12c3-4272-96b3-e7fdfe6383f1"], -Cell[99252, 2527, 978, 31, 70, "Code",ExpressionUUID->"15d3955c-147a-43c6-9a7c-1010061a1c4d"], -Cell[100233, 2560, 6423, 155, 70, "Code",ExpressionUUID->"2df2dc6d-1465-4827-9806-129440d54ee2"], -Cell[106659, 2717, 3044, 90, 70, "Code",ExpressionUUID->"7b79de5c-f878-4238-a38a-63f1f4ab6d42"], -Cell[109706, 2809, 2902, 84, 70, "Code",ExpressionUUID->"3f5e01e0-0a41-47e2-a517-5064edaddb5f"], -Cell[112611, 2895, 2984, 86, 70, "Code",ExpressionUUID->"9d31ab9b-c014-4061-a6ac-bd78f60bec7a"], -Cell[115598, 2983, 3072, 88, 70, "Code",ExpressionUUID->"0c7dd938-3608-4026-ab6a-abe65ccac0cc"], -Cell[118673, 3073, 1191, 33, 70, "Code",ExpressionUUID->"cd29b031-9f14-4e06-87b2-9822025a621d"], -Cell[119867, 3108, 1329, 35, 70, "Code",ExpressionUUID->"caad8ff2-08ab-4344-a59f-c2730b24ef73"], -Cell[121199, 3145, 1477, 38, 70, "Code",ExpressionUUID->"b88a3d39-6677-41af-af1f-fab5413b33ae"], -Cell[122679, 3185, 4060, 112, 70, "Code",ExpressionUUID->"7fa8a0c2-0b8e-44d8-95c2-59236b6f9450"], -Cell[126742, 3299, 112, 1, 70, "Code",ExpressionUUID->"810b9125-fe28-40ac-a3aa-222bd540fd52"] +Cell[558, 20, 19200, 427, 4768, "Code",ExpressionUUID->"55071896-7dee-478b-af1a-901f0294a220"], +Cell[19761, 449, 1623, 46, 258, "Code",ExpressionUUID->"a547e0cf-dec2-485a-83fa-f1bc9a7ba83b"], +Cell[21387, 497, 827, 17, 148, "Code",ExpressionUUID->"b3e8b0f2-b3b8-4e7e-981c-47ba78c1e630"], +Cell[22217, 516, 9489, 250, 897, "Code",ExpressionUUID->"fa2c7bd5-b9fb-40e1-b6de-0cd0666964a6"], +Cell[31709, 768, 1903, 51, 70, "Code",ExpressionUUID->"e7f15e4e-73ad-4479-b5d4-a386f1577606"], +Cell[33615, 821, 3178, 82, 70, "Code",ExpressionUUID->"3f5b4305-3e1a-4ef6-b101-0bd813e77766"], +Cell[36796, 905, 1593, 42, 70, "Code",ExpressionUUID->"20b11a04-6c4d-4464-8bf5-abe3953f7eb1"], +Cell[38392, 949, 1939, 49, 70, "Code",ExpressionUUID->"e7ef70c8-5634-4e95-9336-d0b22aa64202"], +Cell[40334, 1000, 1354, 36, 70, "Code",ExpressionUUID->"ccc64bfc-b63b-4a63-9de2-3f362a58d379"], +Cell[41691, 1038, 573, 13, 70, "Code",ExpressionUUID->"565a83cb-5452-437e-b254-ac09806c2f90"], +Cell[42267, 1053, 9900, 258, 70, "Code",ExpressionUUID->"36055042-66c3-45ae-b165-e451499ec368"], +Cell[52170, 1313, 3222, 85, 70, "Code",ExpressionUUID->"9f2abd4d-22d0-41db-ba30-96b4943bbf4e"], +Cell[55395, 1400, 3761, 94, 70, "Code",ExpressionUUID->"436a5f9a-9da5-422c-89ee-8993a5334c87"], +Cell[59159, 1496, 6434, 164, 70, "Code",ExpressionUUID->"58f3e48b-574a-4258-b8ff-47dc0c3df925"], +Cell[65596, 1662, 3681, 98, 70, "Code",ExpressionUUID->"9771f749-0c07-42c6-ad4a-0e4ebc5dabf1"], +Cell[69280, 1762, 13345, 315, 70, "Code",ExpressionUUID->"8b871bd9-8871-438b-9136-cc1a1b6df891"], +Cell[82628, 2079, 1057, 29, 70, "Code",ExpressionUUID->"c15e087a-66ea-4662-b709-2ed66e45522f"], +Cell[83688, 2110, 3613, 95, 70, "Code",ExpressionUUID->"74eef9e5-a241-4484-b35e-fbe66e11f030"], +Cell[87304, 2207, 8222, 216, 70, "Code",ExpressionUUID->"4a4e77d9-ae6d-43be-b221-67da38249566"], +Cell[95529, 2425, 171, 3, 70, "Code",ExpressionUUID->"ed05ec3d-0722-4612-accf-3e32a6ec9f0e"], +Cell[95703, 2430, 2166, 50, 70, "Code",ExpressionUUID->"d3e35930-001c-4369-b90d-ff7fe7c45fff"], +Cell[97872, 2482, 1241, 37, 70, "Code",ExpressionUUID->"26ed7353-de54-42e8-a24d-5648e3cbcdbd"], +Cell[99116, 2521, 945, 30, 70, "Code",ExpressionUUID->"f2e0a0fb-009b-4704-a5ca-2f8b69b574d3"], +Cell[100064, 2553, 6423, 155, 70, "Code",ExpressionUUID->"5899d05e-52b7-4c7a-b43e-5cec9ddc8b41"], +Cell[106490, 2710, 3044, 90, 70, "Code",ExpressionUUID->"c154546c-2368-42a7-a7fc-8b8b5191c6ce"], +Cell[109537, 2802, 2902, 84, 70, "Code",ExpressionUUID->"907291b5-6fec-4587-bd94-3e0de42edb36"], +Cell[112442, 2888, 2984, 86, 70, "Code",ExpressionUUID->"7c1a27aa-910b-41bc-a48f-f40b211db256"], +Cell[115429, 2976, 3072, 88, 70, "Code",ExpressionUUID->"4437937e-0c49-4762-bb4e-1392d8a271aa"], +Cell[118504, 3066, 1191, 33, 70, "Code",ExpressionUUID->"382763a7-b030-4116-86c0-af048b1ebf92"], +Cell[119698, 3101, 1329, 35, 70, "Code",ExpressionUUID->"63281a84-fdb6-460e-89f8-f0a584461a54"], +Cell[121030, 3138, 1477, 38, 70, "Code",ExpressionUUID->"c90c1ef8-1408-4a27-830f-5e4a7c97c601"], +Cell[122510, 3178, 4116, 114, 70, "Code",ExpressionUUID->"d5f87e14-6ebe-40bb-a69b-7a28930f06f9"], +Cell[126629, 3294, 112, 1, 70, "Code",ExpressionUUID->"fed0e872-9f6e-4e7a-90c8-585e156f381f"] } ] *) diff --git a/TuGamesAux.m b/TuGamesAux.wl similarity index 97% rename from TuGamesAux.m rename to TuGamesAux.wl index c0218ee..f09b981 100644 --- a/TuGamesAux.m +++ b/TuGamesAux.wl @@ -1,6 +1,8 @@ +(* ::Package:: *) + (* :Title: TuGamesAux.m *) -(* Release Date: 31.05.2019 *) -(* Version: 2.5.4 *) +(* Release Date: 22.04.2020 *) +(* Version: 2.6.0 *) (* :Context: TuGamesAux` *) @@ -15,7 +17,7 @@ University of Karlsruhe (KIT) E-Mail: Holger.Meinhardt@wiwi.uni-karlsruhe.de *) -(* :Package Version: 2.5.4 *) +(* :Package Version: 2.6.0 *) (* :Mathematica Version: 8.x, 9.x, 10.x, 11.x, 12.x @@ -87,6 +89,9 @@ University of Karlsruhe (KIT) of sets is balanced. However, use it with care, it returns for n=>4 incorrect results probably due to a bug within the DualLinearProgramming. For an example see ChangeLog. + + Version 2.6.0: + Performing some code maintenance. *) BeginPackage["TUG`TuGamesAux`"]; @@ -175,7 +180,7 @@ University of Karlsruhe (KIT) "NearRingQ[list,T] checks if the collection of sets is a near ring."; LieBracket::usage = -"LieBracket[mat01,mat02} computes the commutator of the (nXn)-matrices mat01 and mat02."; +"LieBracket[mat01,mat02] computes the commutator of the (nXn)-matrices mat01 and mat02."; Coal2Dec::usage = "Coal2Dec[n_Integer] converts the set of proper coalitions to its unique integer representations."; @@ -350,7 +355,7 @@ University of Karlsruhe (KIT) Which[Length[em] != 0, Print["The sets P and Q are not disjoint."]; Return[], True, param = OptionValue[MarketParameter]; - coal = teilm[T]; + coal = Subsets[T]; val = Min[Length[Intersection[#, P]], a Length[Intersection[#, Q]]] & /@ coal; val /. a -> param ] @@ -365,7 +370,7 @@ University of Karlsruhe (KIT) lc=Length[claims]; T=Range[lc]; asscl = MapThread[Rule,{x /@ T,claims}]; - compset = Complement[T,#] &/@ teilm[T]; + compset = Reverse[Subsets[T]]; vecval = Max[0, E - x[#]] &/@ compset; vecval /.asscl ]; @@ -375,7 +380,7 @@ University of Karlsruhe (KIT) lc=Length[claims]; T=Range[lc]; asscl = MapThread[Rule,{x /@ T,claims}]; - vecval = Min[E, x[#]] &/@ teilm[T]; + vecval = Min[E, x[#]] &/@ Subsets[T]; vecval /.asscl ]; @@ -397,14 +402,14 @@ University of Karlsruhe (KIT) TalmudicRule[Estate_?NumberQ, Claims_List] := Module[{clvar, sumcl, param, eqsys, nclsum,sol, sol01}, clvar = Map[x[#] &, Range[Length[Claims]]]; - sumcl = Apply[Plus, clvar]; + sumcl = Total[ clvar]; param = MapThread[Rule, {clvar, Claims}]; nclsum = sumcl /. param; eqsys = If[Greater[(1/2)*nclsum, Estate], Min[\[Lambda], (1/2)*#] & /@ Claims, Max[(# - \[Lambda]), (1/2)*#] & /@ Claims]; - sol = Reduce[Apply[Plus, eqsys] == Estate, \[Lambda]]; + sol = Reduce[Total[ eqsys] == Estate, \[Lambda]]; sol01 = MapThread[Rule, {{\[Lambda]}, {sol[[2]]}}]; eqsys /. sol01 ]; @@ -596,9 +601,9 @@ University of Karlsruhe (KIT) Depth[matchli] === 5, Table[Table[Global`beta[#] & /@ matchli[[j, i]], {i, Length[matchli[[j]]]}], {j, Length[matchli]}], True, Table[Global`beta[#] & /@ matchli[[i]], {i, Length[matchli]}]]; If[SameQ[vrb,True], Print["prfli=", profitli];, True]; - Which[Depth[matchli] <= 3, Max[Apply[Plus, profitli]], - Depth[matchli] === 5, Max[Table[Apply[Plus, #] & /@ profitli[[i]], {i, Length[profitli]}]], - True, Max[Apply[Plus, #] & /@ profitli]] + Which[Depth[matchli] <= 3, Max[Total[ profitli]], + Depth[matchli] === 5, Max[Table[Total[ #] & /@ profitli[[i]], {i, Length[profitli]}]], + True, Max[Total[ #] & /@ profitli]] ]; (* Euclidean Distance, Spelling Euclidian is not protected! *) @@ -609,7 +614,7 @@ University of Karlsruhe (KIT) Depth[liste] == 2, EuclidianDist[liste, refliste], True,DisplayEuk[liste]]; -EuclidianDist[liste_, refliste_] := N[Power[Apply[Plus, MapThread[Power[#1 - #2, 2] &, {liste, refliste}]], (1/2)]]; +EuclidianDist[liste_, refliste_] := N[Power[Total[ MapThread[Power[#1 - #2, 2] &, {liste, refliste}]], (1/2)]]; DisplayEuk[liste_]:=( Print["Depth is equal to ",Depth[liste]]; @@ -641,7 +646,7 @@ University of Karlsruhe (KIT) prs=Delete[ps,1]; xp=prs-1; sxp=(2^#)&/@xp; - Apply[Plus,#]&/@ sxp + Total[#]&/@ sxp ]; @@ -649,7 +654,7 @@ University of Karlsruhe (KIT) Sets2Dec[sets_List]:=Module[{T,ps,prs,xp,sxp}, xp=sets-1; sxp=(2^#)&/@xp; - Apply[Plus,#]&/@ sxp + Total[#]&/@ sxp ]; @@ -783,7 +788,7 @@ University of Karlsruhe (KIT) (* Lie Groups *) LieBracket[args___]:=(Message[LieBracket::argerr];$Failed); -LieBracket[mat01_List,mat02_List]:= mat01.mat02 - mat02.mat01; +LieBracket[mat01_?ListQ,mat02_?ListQ]:= mat01.mat02 - mat02.mat01; (* Linear Algebra *)