<div dir="ltr">



















<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">Hi,<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">Good day.</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">I am facing some issues for adding a new chunk via RPC for my ACT-R model.</p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">I recreated the same using the count model in ACT-R\tutorial\unit1 for problem description purposes.<br></p><p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">I am trying to create a new chunk to the count model.<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">Through command it works (add-dm (test isa count-order first 1 second 2))<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">But when I use my java code (given below)<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><b><span style="font-size:7pt;font-family:"Courier New";color:navy">static void </span></b><span style="font-size:7pt;font-family:"Courier New";color:black">addChunk() {<br>
<span>  </span>JSONArray jsonArray = </span><b><span style="font-size:7pt;font-family:"Courier New";color:navy">new </span></b><span style="font-size:7pt;font-family:"Courier New";color:black">JSONArray();<br>
<span>  </span>jsonArray.put(</span><b><span style="font-size:7pt;font-family:"Courier New";color:green">"{</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">method</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">:</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">evaluate</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,"</span></b><span style="font-size:7pt;font-family:"Courier New";color:black">);<br>
<span>  </span>jsonArray.put(</span><b><span style="font-size:7pt;font-family:"Courier New";color:green">"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">params</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">:"</span></b><span style="font-size:7pt;font-family:"Courier New";color:black">);<br>
<span>  </span></span><i><span style="font-size:7pt;font-family:"Courier New";color:gray">//jsonArray.put("[\"add-dm\",\"count\",\"new\",\"isa\",\"count-order\",\"first\",\"5\",\"second\",\"6\"],");<br>
<span>  </span></span></i><span style="font-size:7pt;font-family:"Courier New";color:black">jsonArray.put(</span><b><span style="font-size:7pt;font-family:"Courier New";color:green">"[</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">define-chunks</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">count</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">new4</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">isa</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">count-order</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">first</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,5,</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">second</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">,6],"</span></b><span style="font-size:7pt;font-family:"Courier New";color:black">);<br>
<span>  </span>jsonArray.put(</span><b><span style="font-size:7pt;font-family:"Courier New";color:green">"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">id</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:navy">\"</span></b><b><span style="font-size:7pt;font-family:"Courier New";color:green">:1}"</span></b><span style="font-size:7pt;font-family:"Courier New";color:black">);<br>
<span>  </span><i>print</i>(jsonArray.getString(</span><span style="font-size:7pt;font-family:"Courier New";color:blue">0</span><span style="font-size:7pt;font-family:"Courier New";color:black">)<br>
<span>      </span>+ jsonArray.getString(</span><span style="font-size:7pt;font-family:"Courier New";color:blue">1</span><span style="font-size:7pt;font-family:"Courier New";color:black">)<br>
<span>      </span>+ jsonArray.getString(</span><span style="font-size:7pt;font-family:"Courier New";color:blue">2</span><span style="font-size:7pt;font-family:"Courier New";color:black">)<br>
<span>      </span>+ jsonArray.getString(</span><span style="font-size:7pt;font-family:"Courier New";color:blue">3</span><span>));
<br>
} <br></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">I am getting an error in command window <span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">(add-dm (test isa count-order first 1 second 2))<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">#|Warning: Invalid chunk definition: (TEST ISA COUNT-ORDER
FIRST 1 SECOND 2) names a chunk which already exists. |#<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">NIL<span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">1 ><span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">I am able to use other commands successfully using my java
code for example the goal-focus command as given below.<span></span></p>

<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><b><span style="font-size:7pt;color:navy">static void </span></b><span style="font-size:7pt;color:black">setGoalFocus() {
<span>  </span>JSONArray jsonArray = </span><b><span style="font-size:7pt;color:navy">new </span></b><span style="font-size:7pt;color:black">JSONArray();
<span>  </span>jsonArray.put(</span><b><span style="font-size:7pt;color:green">"{</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">method</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">:</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">evaluate</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">,"</span></b><span style="font-size:7pt;color:black">);
<span>  </span>jsonArray.put(</span><b><span style="font-size:7pt;color:green">"</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">params</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">:"</span></b><span style="font-size:7pt;color:black">);</span><i><span style="font-size:7pt;color:gray">
<span>  </span></span></i><span style="font-size:7pt;color:black">jsonArray.put(</span><b><span style="font-size:7pt;color:green">"[</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">goal-focus</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">,</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">count</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">,</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">first-goal</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">],"</span></b><span style="font-size:7pt;color:black">);
<span>  </span>jsonArray.put(</span><b><span style="font-size:7pt;color:green">"</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">id</span></b><b><span style="font-size:7pt;color:navy">\"</span></b><b><span style="font-size:7pt;color:green">:1}"</span></b><span style="font-size:7pt;color:black">);
<span>  </span><i>print</i>(jsonArray.getString(</span><span style="font-size:7pt;color:blue">0</span><span style="font-size:7pt;color:black">)
<span>      </span>+ jsonArray.getString(</span><span style="font-size:7pt;color:blue">1</span><span style="font-size:7pt;color:black">) + jsonArray.getString(</span><span style="font-size:7pt;color:blue">2</span><span style="font-size:7pt;color:black">)
<span>      </span>+ jsonArray.getString(</span><span style="font-size:7pt;color:blue">3</span><span style="font-size:7pt;color:black">));
}</span><span> <br></span></pre>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif">Could you please tell me what I am<span>  </span>doing wrong in <span style="font-size:7pt;line-height:107%;font-family:"Courier New";color:black">addChunk() function above?<span></span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span style="font-size:7pt;line-height:107%;font-family:"Courier New";color:black">Thanks
& Regards,<span></span></span></p>

<p class="MsoNormal" style="margin:0in 0in 8pt;line-height:107%;font-size:11pt;font-family:"Calibri",sans-serif"><span style="font-size:7pt;line-height:107%;font-family:"Courier New";color:black">Arun</span><span></span></p><span style="font-size:7pt;line-height:107%;font-family:"Courier New";color:black"></span><span></span>





</div>