Compare commits

..

2 commits

Author SHA1 Message Date
dartz
ed4ab43caf New map 2024-06-01 14:59:02 -04:00
dartz
0e55449e7c Add bias option to simulation 2024-06-01 14:58:40 -04:00
4 changed files with 605 additions and 118 deletions

View file

@ -5,7 +5,7 @@
version="1.1" version="1.1"
id="svg2" id="svg2"
sodipodi:docname="ElectoralCollege2024.svg" sodipodi:docname="ElectoralCollege2024.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -22,15 +22,16 @@
inkscape:pageopacity="0" inkscape:pageopacity="0"
inkscape:pagecheckerboard="1" inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050" inkscape:deskcolor="#505050"
inkscape:zoom="0.78484848" inkscape:zoom="2.2198868"
inkscape:cx="466.96912" inkscape:cx="773.46286"
inkscape:cy="356.11969" inkscape:cy="168.92753"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:window-height="1004" inkscape:window-height="1018"
inkscape:window-x="0" inkscape:window-x="-8"
inkscape:window-y="24" inkscape:window-y="-8"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="g1" /> inkscape:current-layer="svg2"
showguides="true" />
<metadata <metadata
id="metadata1"> id="metadata1">
<rdf:RDF> <rdf:RDF>
@ -219,12 +220,13 @@
x="873.31848" x="873.31848"
y="97.39283" /> y="97.39283" />
<rect <rect
style="fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-dasharray:none;stroke-opacity:1" style="display:inline;fill-opacity:1;stroke:#ffffff;stroke-width:1.5;stroke-dasharray:none;stroke-opacity:1"
id="NE-02" id="NE-02"
width="18.024391" width="18.024391"
height="18.024391" height="18.024391"
x="457.7674" x="457.7674"
y="224.80486" /> y="224.80486"
inkscape:highlight-color="#fbfbfb" />
<rect <rect
style="fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-dasharray:none;stroke-opacity:1" style="fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-dasharray:none;stroke-opacity:1"
id="ME-02" id="ME-02"
@ -242,172 +244,620 @@
id="g1"> id="g1">
<text <text
id="AKn" id="AKn"
x="110" x="121.59544"
y="504">3</text> y="493.18863"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan40"
x="121.59544"
y="493.18863"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">AK</tspan><tspan
sodipodi:role="line"
id="tspan41"
x="121.59544"
y="509.85526"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">3</tspan></text>
<text <text
id="HIn" id="HIn"
x="261" x="281.26047"
y="565">4</text> y="554.18866"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan17"
x="281.26047"
y="554.18866"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">HI</tspan><tspan
sodipodi:role="line"
id="tspan20"
x="281.26047"
y="570.85529"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">4</tspan></text>
<text <text
id="WAn" id="WAn"
x="105" x="117.53755"
y="62">12</text> y="49.386745"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan38"
x="117.53755"
y="49.386745"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">WA</tspan><tspan
sodipodi:role="line"
id="tspan39"
x="117.53755"
y="66.053368"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">12</tspan></text>
<text <text
id="ORn" id="ORn"
x="88" x="95.010078"
y="136">8</text> y="122.48579"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan36"
x="95.010078"
y="122.48579"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">OR</tspan><tspan
sodipodi:role="line"
id="tspan37"
x="95.010078"
y="139.15242"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">8</tspan></text>
<text <text
id="CAn" id="CAn"
x="55" x="69.726158"
y="298">54</text> y="279.08011"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan34"
x="69.726158"
y="279.08011"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">CA</tspan><tspan
sodipodi:role="line"
id="tspan35"
x="69.726158"
y="295.74673"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">54</tspan></text>
<text <text
id="NVn" id="NVn"
x="120" x="133.35632"
y="242">6</text> y="232.08958"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan32"
x="133.35632"
y="232.08958"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">NV</tspan><tspan
sodipodi:role="line"
id="tspan33"
x="133.35632"
y="248.75621"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">6</tspan></text>
<text <text
id="AZn" id="AZn"
x="182" x="188.30663"
y="368">11</text> y="358.99054"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan27"
x="188.30663"
y="358.99054"
style="font-size:13.3333px;fill:#ffffff">AZ</tspan><tspan
sodipodi:role="line"
id="tspan28"
x="188.30663"
y="375.65717"
style="font-size:13.3333px;fill:#ffffff">11</tspan></text>
<text <text
id="UTn" id="UTn"
x="209" x="219.70537"
y="265">6</text> y="251.48579"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan25"
x="219.70537"
y="251.48579"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">UT</tspan><tspan
sodipodi:role="line"
id="tspan26"
x="219.70537"
y="268.15244"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">6</tspan></text>
<text <text
id="IDn" id="IDn"
x="183" x="194.15645"
y="162">4</text> y="151.80695"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan21"
x="194.15645"
y="151.80695"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">ID</tspan><tspan
sodipodi:role="line"
x="194.15645"
y="168.47357"
id="tspan22"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">4</tspan></text>
<text <text
id="MTn" id="MTn"
x="270" x="279.21573"
y="100">4</text> y="85.347488"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan15"
x="279.21573"
y="85.347488"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">MT</tspan><tspan
sodipodi:role="line"
id="tspan16"
x="279.21573"
y="102.01411"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">4</tspan></text>
<text <text
id="WYn" id="WYn"
x="290" x="298.39981"
y="191">3</text> y="182.08109"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan18"
x="298.39981"
y="182.08109"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">WY</tspan><tspan
sodipodi:role="line"
x="298.39981"
y="198.74771"
id="tspan19"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">3</tspan></text>
<text <text
id="COn" id="COn"
x="297.22601" x="319.78827"
y="281.55011">10</text> y="270.08292"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan23"
x="319.78827"
y="270.08292"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">CO</tspan><tspan
sodipodi:role="line"
id="tspan24"
x="319.78827"
y="286.74954"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">10</tspan></text>
<text <text
id="NMn" id="NMn"
x="290" x="302.97266"
y="381">5</text> y="369.28769"
style="font-size:16px"><tspan
sodipodi:role="line"
id="tspan29"
x="302.97266"
y="369.28769"
style="font-size:16px;text-align:center;text-anchor:middle;fill:#ffffff">NM</tspan><tspan
sodipodi:role="line"
x="302.97266"
y="389.28769"
id="tspan31"
style="font-size:16px;text-align:center;text-anchor:middle;fill:#ffffff">5</tspan></text>
<text <text
id="TXn" id="TXn"
x="410" x="415.85614"
y="458">40</text> y="451.69336"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan1"
x="415.85614"
y="451.69336"
style="font-size:13.3333px;fill:#ffffff;fill-opacity:1">TX</tspan><tspan
sodipodi:role="line"
id="tspan2"
x="415.85614"
y="468.35999"
style="font-size:13.3333px;fill:#ffffff;fill-opacity:1">40</tspan></text>
<text <text
id="OKn" id="OKn"
x="451" x="461.73621"
y="370">7</text> y="358.28769"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1"><tspan
sodipodi:role="line"
id="tspan3"
x="461.73621"
y="358.28769">OK</tspan><tspan
sodipodi:role="line"
id="tspan6"
x="461.73621"
y="374.95435">7</tspan></text>
<text <text
id="KSn" id="KSn"
x="434" x="441.22095"
y="303">6</text> y="289.62161"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1"><tspan
sodipodi:role="line"
id="tspan7"
x="441.22095"
y="289.62161">KS</tspan><tspan
sodipodi:role="line"
id="tspan8"
x="441.22095"
y="306.28827">6</tspan></text>
<text <text
id="NEn" id="NEn"
x="411" x="414.12476"
y="232">5</text> y="221.48842"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan9"
x="414.12476"
y="221.48842"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">NE</tspan><tspan
sodipodi:role="line"
id="tspan10"
x="414.12476"
y="238.15504"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">4</tspan></text>
<text <text
id="SDn" id="SDn"
x="405" x="415.85419"
y="170">3</text> y="157.25868"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan11"
x="415.85419"
y="157.25868"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">SD</tspan><tspan
sodipodi:role="line"
id="tspan12"
x="415.85419"
y="173.92531"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">3</tspan></text>
<text <text
id="NDn" id="NDn"
x="405" x="417.25748"
y="103">3</text> y="91.851349"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan13"
x="417.25748"
y="91.851349"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">ND</tspan><tspan
sodipodi:role="line"
id="tspan14"
x="417.25748"
y="108.51797"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">3</tspan></text>
<text <text
id="MNn" id="MNn"
x="484" x="504.72253"
y="129">10</text> y="124.94574"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan30"
x="504.72253"
y="124.94574"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">MN</tspan><tspan
sodipodi:role="line"
id="tspan42"
x="504.72253"
y="141.61237"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">10</tspan></text>
<text <text
id="WIn" id="WIn"
x="561" x="579.54468"
y="163">10</text> y="159.84668"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan71"
x="579.54468"
y="159.84668"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">WI</tspan><tspan
sodipodi:role="line"
id="tspan72"
x="579.54468"
y="176.51331"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">10</tspan></text>
<text <text
id="ILn" id="ILn"
x="579" x="596.69891"
y="261">19</text> y="249.73816"
style="font-size:13.3333px;fill:#ffffff"><tspan
sodipodi:role="line"
id="tspan73"
x="596.69891"
y="249.73816"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">IL</tspan><tspan
sodipodi:role="line"
id="tspan74"
x="596.69891"
y="266.40479"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">19</tspan></text>
<text <text
id="IAn" id="IAn"
x="513" x="521.78705"
y="224">6</text> y="212.28769"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan43"
x="521.78705"
y="212.28769"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">IA</tspan><tspan
sodipodi:role="line"
id="tspan44"
x="521.78705"
y="228.95432"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">6</tspan></text>
<text <text
id="MOn" id="MOn"
x="525" x="540.95941"
y="306">10</text> y="292.93628"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan45"
x="540.95941"
y="292.93628"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">MO</tspan><tspan
sodipodi:role="line"
id="tspan46"
x="540.95941"
y="309.60291"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">10</tspan></text>
<text <text
id="ARn" id="ARn"
x="534" x="547.24762"
y="384">6</text> y="374.0896"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan51"
x="547.24762"
y="374.0896"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">AR</tspan><tspan
sodipodi:role="line"
id="tspan52"
x="547.24762"
y="390.75623"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">6</tspan></text>
<text <text
id="LAn" id="LAn"
x="536" x="545.79749"
y="452">8</text> y="450.64859"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan53"
x="545.79749"
y="450.64859"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">LA</tspan><tspan
sodipodi:role="line"
id="tspan54"
x="545.79749"
y="467.31522"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">8</tspan></text>
<text <text
id="MSn" id="MSn"
x="587" x="597.98846"
y="428">6</text> y="417.18863"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan47"
x="597.98846"
y="417.18863"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">MS</tspan><tspan
sodipodi:role="line"
id="tspan48"
x="597.98846"
y="433.85526"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">6</tspan></text>
<text <text
id="ALn" id="ALn"
x="641" x="650.66272"
y="422">9</text> y="409.38675"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan57"
x="650.66272"
y="409.38675"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">AL</tspan><tspan
sodipodi:role="line"
id="tspan58"
x="650.66272"
y="426.05338"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">9</tspan></text>
<text <text
id="GAn" id="GAn"
x="697" x="714.30121"
y="419">16</text> y="407.73816"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan49"
x="714.30121"
y="407.73816"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">GA</tspan><tspan
sodipodi:role="line"
id="tspan50"
x="714.30121"
y="424.40479"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">16</tspan></text>
<text <text
id="FLn" id="FLn"
x="743" x="763.43597"
y="505">30</text> y="504.54953"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan55"
x="763.43597"
y="504.54953"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#f8f8f8;fill-opacity:1">FL</tspan><tspan
sodipodi:role="line"
id="tspan56"
x="763.43597"
y="521.21613"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#f8f8f8;fill-opacity:1">30</tspan></text>
<text <text
id="SCn" id="SCn"
x="745" x="759.23254"
y="380">9</text> y="347.11545"><tspan
sodipodi:role="line"
id="tspan59"
x="759.23254"
y="347.11545" /><tspan
sodipodi:role="line"
x="759.23254"
y="382.11545"
id="tspan61"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">SC 9</tspan></text>
<text <text
id="NCn" id="NCn"
x="763" x="781.7052"
y="342">16</text> y="328.48581"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan67"
x="781.7052"
y="328.48581"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">NC</tspan><tspan
sodipodi:role="line"
id="tspan68"
x="781.7052"
y="345.15244"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">16</tspan></text>
<text <text
id="TNn" id="TNn"
x="633" x="655.9707"
y="353">11</text> y="340.83722"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan65"
x="655.9707"
y="340.83722"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">TN</tspan><tspan
sodipodi:role="line"
id="tspan66"
x="655.9707"
y="357.50385"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">11</tspan></text>
<text <text
id="KYn" id="KYn"
x="666" x="675.10925"
y="311">8</text> y="299.28769"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan69"
x="675.10925"
y="299.28769"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">KY</tspan><tspan
sodipodi:role="line"
id="tspan70"
x="675.10925"
y="315.95432"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">8</tspan></text>
<text <text
id="INn" id="INn"
x="630" x="644.74738"
y="262">11</text> y="248.48579"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan77"
x="644.74738"
y="248.48579"
style="text-align:center;text-anchor:middle;fill:#ffffff">IN</tspan><tspan
sodipodi:role="line"
id="tspan78"
x="644.74738"
y="265.15244"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">11</tspan></text>
<text <text
id="MIn" id="MIn"
x="645" x="663.32098"
y="193">15</text> y="183.08958"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan79"
x="663.32098"
y="183.08958"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">MI</tspan><tspan
sodipodi:role="line"
id="tspan80"
x="663.32098"
y="199.75621"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">15</tspan></text>
<text <text
id="OHn" id="OHn"
x="685" x="700.31543"
y="248">17</text> y="235.38675"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan81"
x="700.31543"
y="235.38675"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">OH</tspan><tspan
sodipodi:role="line"
id="tspan82"
x="700.31543"
y="252.05338"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">17</tspan></text>
<text <text
id="WVn" id="WVn"
x="730" x="738.71716"
y="281">4</text> y="272.44101"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan83"
x="738.71716"
y="272.44101"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">WV</tspan><tspan
sodipodi:role="line"
id="tspan84"
x="738.71716"
y="289.10764"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">4</tspan></text>
<text <text
id="VAn" id="VAn"
x="767" x="771.05426"
y="294">13</text> y="282.73816"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan85"
x="771.05426"
y="282.73816"
style="font-size:13.3333px;fill:#ffffff">VA</tspan><tspan
sodipodi:role="line"
id="tspan86"
x="771.05426"
y="299.40479"
style="font-size:13.3333px;fill:#ffffff">13</tspan></text>
<text <text
id="PAn" id="PAn"
x="764" x="779.22137"
y="220">19</text> y="210.08958"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan87"
x="779.22137"
y="210.08958"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">PA</tspan><tspan
sodipodi:role="line"
id="tspan88"
x="779.22137"
y="226.75621"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff">19</tspan></text>
<text <text
id="NYn" id="NYn"
x="798" x="811.52887"
y="167">28</text> y="153.03532"
style="font-size:13.3333px"><tspan
sodipodi:role="line"
id="tspan89"
x="811.52887"
y="153.03532"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">NY</tspan><tspan
sodipodi:role="line"
x="811.52887"
y="169.70195"
id="tspan91"
style="font-size:13.3333px;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">28</tspan></text>
<text <text
id="MEn" id="MEn"
x="901.54358" x="901.54358"
y="94.712509">2</text> y="94.712509"
style="font-size:16px"><tspan
style="fill:#ffffff"
id="tspan101">2</tspan></text>
<text <text
id="MEn-9" id="MEn-9"
x="885.10718" x="885.10718"
@ -417,12 +867,12 @@
id="tspan4" id="tspan4"
x="885.10718" x="885.10718"
y="80.869125" y="80.869125"
style="stroke-width:0.52686">1</tspan><tspan style="fill:#ffffff;stroke-width:0.52686">1</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan5" id="tspan5"
x="885.10718" x="885.10718"
y="99.30925" y="99.30925"
style="stroke-width:0.52686" /></text> style="fill:#ffffff;stroke-width:0.52686" /></text>
<text <text
id="MEn-9-7" id="MEn-9-7"
x="877.93567" x="877.93567"
@ -432,12 +882,12 @@
id="tspan4-0" id="tspan4-0"
x="877.93567" x="877.93567"
y="111.5111" y="111.5111"
style="stroke-width:0.52686">1</tspan><tspan style="fill:#ffffff;stroke-width:0.52686">1</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan5-9" id="tspan5-9"
x="877.93567" x="877.93567"
y="129.95122" y="129.95123"
style="stroke-width:0.52686" /></text> style="fill:#ffffff;stroke-width:0.52686" /></text>
<text <text
id="MEn-9-0" id="MEn-9-0"
x="463.3028" x="463.3028"
@ -447,12 +897,12 @@
id="tspan4-6" id="tspan4-6"
x="463.3028" x="463.3028"
y="239.15771" y="239.15771"
style="stroke-width:0.52686">1</tspan><tspan style="fill:#ffffff;fill-opacity:1;stroke-width:0.52686">1</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan5-2" id="tspan5-2"
x="463.3028" x="463.3028"
y="257.59784" y="257.59784"
style="stroke-width:0.52686" /></text> style="fill:#ffffff;fill-opacity:1;stroke-width:0.52686" /></text>
<text <text
id="DemL" id="DemL"
x="855" x="855"
@ -467,40 +917,67 @@
id="g2"> id="g2">
<text <text
id="NHn" id="NHn"
x="800" x="817.56848"
y="58">NH 4</text> y="56.648579"
style="font-size:16px"><tspan
style="font-size:16px;fill:#ffffff"
id="tspan92">NH 4</tspan></text>
<text <text
id="VTn" id="VTn"
x="790" x="802.61328"
y="82">VT 3</text> y="81.54953"
style="font-size:16px"><tspan
style="fill:#ffffff"
id="tspan93">VT 3</tspan></text>
<text <text
id="MAn" id="MAn"
x="927" x="927"
y="164">MA 11</text> y="164"
style="font-size:16px"><tspan
style="fill:#ffffff"
id="tspan94">MA 11</tspan></text>
<text <text
id="RIn" id="RIn"
x="925" x="925"
y="199">RI 4</text> y="199"
style="font-size:16px"><tspan
style="font-size:16px;fill:#ffffff"
id="tspan95">RI 4</tspan></text>
<text <text
id="CTn" id="CTn"
x="918" x="918"
y="228">CT 7</text> y="228"
style="font-size:16px"><tspan
style="fill:#ffffff"
id="tspan96">CT 7</tspan></text>
<text <text
id="NJn" id="NJn"
x="898" x="898"
y="260">NJ 14</text> y="260"
style="font-size:16px"><tspan
style="fill:#ffffff"
id="tspan97">NJ 14</tspan></text>
<text <text
id="DEn" id="DEn"
x="891" x="891"
y="284">DE 3</text> y="284"
style="font-size:16px"><tspan
style="font-size:16px;fill:#ffffff"
id="tspan98">DE 3</tspan></text>
<text <text
id="MDn" id="MDn"
x="883" x="883"
y="305">MD 10</text> y="305"
style="font-size:16px"><tspan
style="font-size:16px;fill:#ffffff"
id="tspan99">MD 10</tspan></text>
<text <text
id="DCn" id="DCn"
x="864" x="864"
y="327">DC 3</text> y="327"
style="font-size:16px"><tspan
style="font-size:16px;fill:#ffffff"
id="tspan100">DC 3</tspan></text>
</g> </g>
</g> </g>
<!-- <!--
@ -511,7 +988,8 @@
id="lines" id="lines"
d="m844 62 13 29m-25-5 8 17m49 50 34 3m-41 22 41 12m-57-6 51 33m-72 13 50 22m-58-2 51 26m-55-15 46 33m-79-43 61 61" d="m844 62 13 29m-25-5 8 17m49 50 34 3m-41 22 41 12m-57-6 51 33m-72 13 50 22m-58-2 51 26m-55-15 46 33m-79-43 61 61"
stroke="#000" stroke="#000"
stroke-width="1.6" /> stroke-width="1.6"
style="stroke:#fdfdfd;stroke-opacity:1" />
<path <path
id="frames" id="frames"
d="M215,493v55l36,45 M0,425h147l68,68h85l54,54v46" d="M215,493v55l36,45 M0,425h147l68,68h85l54,54v46"

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -1,7 +1,15 @@
import {ApplicationCommandOptionType} from "discord.js";
const commands = [ const commands = [
{ {
name: 'simulate', name: 'simulate',
description: "Simulate the 2024 United States Presidential Election", description: "Simulate the 2024 United States Presidential Election",
options: [
{
name: 'bias',
description: 'Adds a bias to a certain candidate. Use a positive number for Biden bias, negative for Trump bias',
type: ApplicationCommandOptionType.Number,
}
],
} }
]; ];

View file

@ -23,9 +23,9 @@ if (!config.token) {
if (i instanceof CommandInteraction) { if (i instanceof CommandInteraction) {
switch (i.commandName) { switch (i.commandName) {
case "simulate": case "simulate":
var result = await MakePrediction(); var result = await MakePrediction(Number(i.options.get('bias')?.value));
var embed = new EmbedBuilder() var embed = new EmbedBuilder()
.setTitle("2024 United States Presidential Election") .setTitle("2024 United States Presidential Election Simulator")
.setDescription(`The CalubViem Press has called the 2024 United States Presidential Election for ${result.winner}!`) .setDescription(`The CalubViem Press has called the 2024 United States Presidential Election for ${result.winner}!`)
.addFields( .addFields(
{name: `${result.winner === result.gopCandidate ? ":white_check_mark:" : ""} ${result.gopCandidate}`, value: `${result.gopVotes} Electoral Votes`, inline: true}, {name: `${result.winner === result.gopCandidate ? ":white_check_mark:" : ""} ${result.gopCandidate}`, value: `${result.gopVotes} Electoral Votes`, inline: true},

View file

@ -9,8 +9,9 @@ const GOP_CANDIDATE = "Donald J. Trump";
const DEM_CANDIDATE = "Joseph R. Biden Jr."; const DEM_CANDIDATE = "Joseph R. Biden Jr.";
const BASE_SVG = await fs.readFile("assets/ElectoralCollege2024.svg", "utf-8"); const BASE_SVG = await fs.readFile("assets/ElectoralCollege2024.svg", "utf-8");
export function MakePrediction() : Promise<Prediction> { export function MakePrediction(bias: number) : Promise<Prediction> {
return new Promise(async res => { return new Promise(async res => {
if (Number.isNaN(bias)) bias = 0;
const window = createSVGWindow(); const window = createSVGWindow();
registerWindow(window, window.document); registerWindow(window, window.document);
var election = {} as any; var election = {} as any;
@ -19,17 +20,17 @@ export function MakePrediction() : Promise<Prediction> {
var draw = SVG(window.document.documentElement); var draw = SVG(window.document.documentElement);
draw.svg(BASE_SVG); draw.svg(BASE_SVG);
Object.keys(ELECTORAL_COLLEGE).forEach(state => { Object.keys(ELECTORAL_COLLEGE).forEach(state => {
if ((GOP_WIN_ODDS as any)[state] >= Math.random()) { if ((GOP_WIN_ODDS as any)[state] >= bias + Math.random()) {
election[state] = "R"; election[state] = "R";
gopVotes += (ELECTORAL_COLLEGE as any)[state]; gopVotes += (ELECTORAL_COLLEGE as any)[state];
// @ts-ignore // @ts-ignore
draw.find(`#${state}`).fill("#F07763"); draw.find(`#${state}`).fill("#BF1D29");
} }
else { else {
election[state] = "D"; election[state] = "D";
demVotes += (ELECTORAL_COLLEGE as any)[state]; demVotes += (ELECTORAL_COLLEGE as any)[state];
// @ts-ignore // @ts-ignore
draw.find(`#${state}`).fill("#698DC5"); draw.find(`#${state}`).fill("#1C408C");
} }
}); });
var s = sharp(Buffer.from(draw.svg())); var s = sharp(Buffer.from(draw.svg()));