<span class="n">library</span><span class="p">(</span><span class="n">RelationalContracts</span><span class="p">)</span><span class="w"> </span><span class="n">g</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">rel_game</span><span class="p">(</span><span class="s2">"Mutual Gift Game with Endogenous Vulnerability"</span><span class="p">)</span><span class="w"> </span><span class="o">%>%</span><span class="w"> </span><span class="n">rel_param</span><span class="p">(</span><span class="n">vul</span><span class="o">=</span><span class="m">1</span><span class="p">,</span><span class="w"> </span><span class="n">delta</span><span class="o">=</span><span class="m">0.3</span><span class="p">)</span><span class="w"> </span><span class="o">%>%</span><span class="w"> </span><span class="n">rel_state</span><span class="p">(</span><span class="s2">"x_0"</span><span class="p">,</span><span class="w"> </span><span class="n">A1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">list</span><span class="p">(</span><span class="n">move</span><span class="o">=</span><span class="nf">c</span><span class="p">(</span><span class="s2">"vul"</span><span class="p">,</span><span class="s2">"not"</span><span class="p">)),</span><span class="w"> </span><span class="n">pi1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">,</span><span class="w"> </span><span class="n">pi2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">%>%</span><span class="w"> </span><span class="n">rel_transition</span><span class="p">(</span><span class="s2">"x_0"</span><span class="p">,</span><span class="s2">"x_not"</span><span class="p">,</span><span class="n">move</span><span class="o">=</span><span class="s2">"not"</span><span class="p">,</span><span class="n">prob</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">1</span><span class="p">)</span><span class="w"> </span><span class="o">%>%</span><span class="w"> </span><span class="n">rel_transition</span><span class="p">(</span><span class="s2">"x_0"</span><span class="p">,</span><span class="s2">"x_vul"</span><span class="p">,</span><span class="n">move</span><span class="o">=</span><span class="s2">"vul"</span><span class="p">,</span><span class="n">prob</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">1</span><span class="p">)</span><span class="w"> </span><span class="o">%>%</span><span class="w"> </span><span class="n">rel_state</span><span class="p">(</span><span class="s2">"x_not"</span><span class="p">,</span><span class="w"> </span><span class="n">A1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">list</span><span class="p">(</span><span class="n">e1</span><span class="o">=</span><span class="n">seq</span><span class="p">(</span><span class="m">0</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="n">by</span><span class="o">=</span><span class="m">0.1</span><span class="p">)),</span><span class="w"> </span><span class="n">A2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">list</span><span class="p">(</span><span class="n">e2</span><span class="o">=</span><span class="n">seq</span><span class="p">(</span><span class="m">0</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="n">by</span><span class="o">=</span><span class="m">0.1</span><span class="p">)),</span><span class="w"> </span><span class="n">pi1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="n">e2</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="m">0.5</span><span class="o">*</span><span class="n">e1</span><span class="o">^</span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="n">pi2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="n">e1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="m">0.5</span><span class="o">*</span><span class="n">e2</span><span class="o">^</span><span class="m">2</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">%>%</span><span class="w"> </span><span class="n">rel_state</span><span class="p">(</span><span class="s2">"x_vul"</span><span class="p">,</span><span class="w"> </span><span class="n">A1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">list</span><span class="p">(</span><span class="n">e1</span><span class="o">=</span><span class="n">seq</span><span class="p">(</span><span class="m">0</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="n">by</span><span class="o">=</span><span class="m">0.1</span><span class="p">)),</span><span class="w"> </span><span class="n">A2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">list</span><span class="p">(</span><span class="n">e2</span><span class="o">=~</span><span class="nf">c</span><span class="p">(</span><span class="o">-</span><span class="n">vul</span><span class="p">,</span><span class="n">seq</span><span class="p">(</span><span class="m">0</span><span class="p">,</span><span class="m">1</span><span class="p">,</span><span class="n">by</span><span class="o">=</span><span class="m">0.1</span><span class="p">))),</span><span class="w"> </span><span class="n">pi1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="n">e2</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="m">0.5</span><span class="o">*</span><span class="n">e1</span><span class="o">^</span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="n">pi2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">~</span><span class="w"> </span><span class="n">e1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="m">0.5</span><span class="o">*</span><span class="n">pmax</span><span class="p">(</span><span class="n">e2</span><span class="p">,</span><span class="m">0</span><span class="p">)</span><span class="o">^</span><span class="m">2</span><span class="w"> </span><span class="p">)</span><span class="w"> </span>... [Read more...]
Copyright © 2022 | MH Corporate basic by MH Themes