<div dir="ltr"><div>Hi Dan,</div><div><br></div><div>Thank you for the reply.</div><div><br></div><div>In my case chunk-slot-value returns the slot value defined by add-dm command</div><div>for example I have an add-dm with</div><div>(navigation-begin ISA navigation navigationStart "state-1" navigationEnd "state-16" navigationCurrent "state-1") <br></div><div>So</div><div><br></div><div>? (chunk-slot-value navigation-begin navigationCurrent)<br>"state-1"<br>?</div><div><br></div><div>I always get "state-1".</div><div><br></div><div>But the goal buffer has a different content in the same time which is given below</div><div><br></div><div><div><img src="cid:ii_kg6mlcpp0" alt="image.png" style="margin-right: 0px;" width="340" height="185"></div><div><br></div><div>I was trying to retrieve the value of NAVIGATIONCURRENT slot from the goal buffer which is "state-2" .</div><div>(Which is the result of a production while running the model)</div><div><br></div><div>Could you please tell me how to achieve this using RPC?</div><div><br></div><div>Thanks & Regards,</div><div>Arun<br></div><div><br></div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 12, 2020 at 2:07 AM Dan Bothell <<a href="mailto:db30@andrew.cmu.edu">db30@andrew.cmu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p><br>
</p>
<div>On 10/11/20 12:23 PM, Arun Krishna
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>Hi,</span></p>
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><br>
</p>
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif">Missed
to mention "Subject" in the previous mail. Sending the same
again with "Subject"<br>
</p>
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span></span></span></p>
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>It would be great if I get some
support regarding the RPC for reading the slot values of the
chunk in the goal
buffer.<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>I have a chunk in the goal buffer
which has 3 slots and values defined for each of the slots.<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>Via command line I can read using
(goal-focus) and I get the output<span></span></span></p>
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </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:black">(goal-focus)
NAVIGATION-BEGIN-0
NAVIGATIONSTART "state-1"
NAVIGATIONEND "state-16"
NAVIGATIONCURRENT "state-2"<span></span></span></b></pre>
<p class="MsoNormal" style="margin:0in;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>There are 3 slots and values
(state-1,state-16,state-2) for each of the slots.<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>I was trying to read these values
via RPC in my java application<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>Java code:<span></span></span></p>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:navy">static void </span><span style="font-size:7pt;color:black">getGoalFocus() {
<span> </span>JSONArray jsonArray = </span><span style="font-size:7pt;color:navy">new </span><span style="font-size:7pt;color:black">JSONArray();
<span> </span>jsonArray.put(</span><span style="font-size:7pt;color:green">"{</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">method</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">:</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">evaluate</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">,"</span><span style="font-size:7pt;color:black">);
<span> </span>jsonArray.put(</span><span style="font-size:7pt;color:green">"</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">params</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">:"</span><span style="font-size:7pt;color:black">);
<span> </span>jsonArray.put(</span><span style="font-size:7pt;color:green">"[</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">goal-focus</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">,</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">cmn</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">],"</span><span style="font-size:7pt;color:black">);
<span> </span>jsonArray.put(</span><span style="font-size:7pt;color:green">"</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">id</span><span style="font-size:7pt;color:navy">\"</span><span style="font-size:7pt;color:green">:1}"</span><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></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black"><span> </span></span></pre>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>But I get only the name of the chunk
in the goal buffer as output shown below<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><br>
</span><b><span>{"result":
["NAVIGATION-BEGIN-0"], "error": null, "id": 1}</span></b><b><span><br>
</span></b><b><span>Result:
NAVIGATION-BEGIN-0</span></b><b><span><span></span></span></b></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>I was trying to read the values of
the slots of the goal buffer also
(state-1,state-16,state-2), not only the chunk
name.<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>I tried using the other command
buffer-chunk
((buffer-chunk goal)) also but still not getting the slot
values in the goal
buffer via RPC (Getting full output via command line but not
via RPC).<span></span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span><span> </span></span></p>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>Command line:<span></span></span></p>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black">1 > (buffer-chunk goal)<span></span></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black">GOAL: NAVIGATION-BEGIN-0<span></span></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black">NAVIGATION-BEGIN-0<span></span></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black"><span> </span>NAVIGATIONSTART<span> </span>"state-1"<span></span></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black"><span> </span>NAVIGATIONEND<span> </span>"state-16"<span></span></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black"><span> </span>NAVIGATIONCURRENT<span> </span>"state-2"<span></span></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black"><span> </span></span></pre>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>Java Code:<span></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">getBufferChunk() {
<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> </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">buffer-chunk</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">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></span></pre>
<pre style="background:white none repeat scroll 0% 0%;margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New""><span style="font-size:7pt;color:black"><span> </span></span></pre>
<p class="MsoNormal" style="margin:0in;text-align:justify;line-height:normal;font-size:11pt;font-family:"Calibri",sans-serif"><span>Could you please let me know how to
get the values of the slots of the goal buffer via RPC?<span></span></span></p>
<br>
</div>
</blockquote>
<p><br>
</p>
<p>Those are the correct return values from goal-focus and
buffer-chunk (when it is given a buffer name). Goal-focus returns
the name of the chunk in the goal buffer, and buffer-chunk returns
a list of the names of the chunks in the buffers specified. The
output to the command-trace with the buffer's chunk information is
a side effect of calling those commands, and you will see that
when you call it remotely as well. <br>
</p>
<p>If you want to know what slots a chunk has, then you would use
the chunk-filled-slots-list command passing it the chunk's name,
and it will return a list of the slots it has. If you want to know
what the value of a slot in a chunk is then you need to use the
chunk-slot-value command. It requires the name of the chunk and
the name of a slot, and then returns the value in that slot of
that chunk.</p>
<p>Hope that helps,<br>
</p>
Dan
</div>
</blockquote></div>