From arunbkris at gmail.com Sun Oct 11 12:19:25 2020 From: arunbkris at gmail.com (Arun Krishna) Date: Sun, 11 Oct 2020 18:19:25 +0200 Subject: [ACT-R-users] (no subject) Message-ID: Hi, It would be great if I get some support regarding the RPC for reading the slot values of the chunk in the goal buffer. I have a chunk in the goal buffer which has 3 slots and values defined for each of the slots. Via command line I can read using (goal-focus) and I get the output *(goal-focus) NAVIGATION-BEGIN-0 NAVIGATIONSTART "state-1" NAVIGATIONEND "state-16" NAVIGATIONCURRENT "state-2"* There are 3 slots and values (state-1,state-16,state-2) for each of the slots. I was trying to read these values via RPC in my java application Java code: static void getGoalFocus() { JSONArray jsonArray = new JSONArray(); jsonArray.put("{\"method\":\"evaluate\","); jsonArray.put("\"params\":"); jsonArray.put("[\"goal-focus\",\"cmn\"],"); jsonArray.put("\"id\":1}"); *print*(jsonArray.getString(0) + jsonArray.getString(1) + jsonArray.getString(2) + jsonArray.getString(3)); } But I get only the name of the chunk in the goal buffer as output shown below *{"result": ["NAVIGATION-BEGIN-0"], "error": null, "id": 1}* *Result: NAVIGATION-BEGIN-0* 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. 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). Command line: 1 > (buffer-chunk goal) GOAL: NAVIGATION-BEGIN-0 NAVIGATION-BEGIN-0 NAVIGATIONSTART "state-1" NAVIGATIONEND "state-16" NAVIGATIONCURRENT "state-2" Java Code: *static void *getBufferChunk() { JSONArray jsonArray = *new *JSONArray(); jsonArray.put(*"{**\"**method**\"**:**\"**evaluate**\"**,"*); jsonArray.put(*"**\"**params**\"**:"*); jsonArray.put(*"[**\"**buffer-chunk**\"**,**\"**goal**\"**],"*); jsonArray.put(*"**\"**id**\"**:1}"*); *print*(jsonArray.getString(0) + jsonArray.getString(1) + jsonArray.getString(2) + jsonArray.getString(3)); } Could you please let me know how to get the values of the slots of the goal buffer via RPC? Thanks & Regards, Arun -------------- next part -------------- An HTML attachment was scrubbed... URL: From arunbkris at gmail.com Sun Oct 11 12:23:46 2020 From: arunbkris at gmail.com (Arun Krishna) Date: Sun, 11 Oct 2020 18:23:46 +0200 Subject: [ACT-R-users] Regarding getting the values of the slots of the goal buffer via RPC Message-ID: Hi, Missed to mention "Subject" in the previous mail. Sending the same again with "Subject" It would be great if I get some support regarding the RPC for reading the slot values of the chunk in the goal buffer. I have a chunk in the goal buffer which has 3 slots and values defined for each of the slots. Via command line I can read using (goal-focus) and I get the output *(goal-focus) NAVIGATION-BEGIN-0 NAVIGATIONSTART "state-1" NAVIGATIONEND "state-16" NAVIGATIONCURRENT "state-2"* There are 3 slots and values (state-1,state-16,state-2) for each of the slots. I was trying to read these values via RPC in my java application Java code: static void getGoalFocus() { JSONArray jsonArray = new JSONArray(); jsonArray.put("{\"method\":\"evaluate\","); jsonArray.put("\"params\":"); jsonArray.put("[\"goal-focus\",\"cmn\"],"); jsonArray.put("\"id\":1}"); *print*(jsonArray.getString(0) + jsonArray.getString(1) + jsonArray.getString(2) + jsonArray.getString(3)); } But I get only the name of the chunk in the goal buffer as output shown below *{"result": ["NAVIGATION-BEGIN-0"], "error": null, "id": 1}* *Result: NAVIGATION-BEGIN-0* 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. 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). Command line: 1 > (buffer-chunk goal) GOAL: NAVIGATION-BEGIN-0 NAVIGATION-BEGIN-0 NAVIGATIONSTART "state-1" NAVIGATIONEND "state-16" NAVIGATIONCURRENT "state-2" Java Code: *static void *getBufferChunk() { JSONArray jsonArray = *new *JSONArray(); jsonArray.put(*"{**\"**method**\"**:**\"**evaluate**\"**,"*); jsonArray.put(*"**\"**params**\"**:"*); jsonArray.put(*"[**\"**buffer-chunk**\"**,**\"**goal**\"**],"*); jsonArray.put(*"**\"**id**\"**:1}"*); *print*(jsonArray.getString(0) + jsonArray.getString(1) + jsonArray.getString(2) + jsonArray.getString(3)); } Could you please let me know how to get the values of the slots of the goal buffer via RPC? Thanks & Regards, Arun -------------- next part -------------- An HTML attachment was scrubbed... URL: From db30 at andrew.cmu.edu Sun Oct 11 20:07:02 2020 From: db30 at andrew.cmu.edu (Dan Bothell) Date: Sun, 11 Oct 2020 20:07:02 -0400 Subject: [ACT-R-users] Regarding getting the values of the slots of the goal buffer via RPC In-Reply-To: References: Message-ID: On 10/11/20 12:23 PM, Arun Krishna wrote: > > Hi, > > > Missed to mention "Subject" in the previous mail. Sending the same > again with "Subject" > > It would be great if I get some support regarding the RPC for reading > the slot values of the chunk in the goal buffer. > > I have a chunk in the goal buffer which has 3 slots and values defined > for each of the slots. > > Via command line I can read using (goal-focus) and I get the output > > *(goal-focus) NAVIGATION-BEGIN-0 ? ?NAVIGATIONSTART ?"state-1" ? > ?NAVIGATIONEND ?"state-16" ? ?NAVIGATIONCURRENT ?"state-2"* > > There are 3 slots and values (state-1,state-16,state-2) for each of > the slots. > > I was trying to read these values via RPC in my java application > > Java code: > > static void getGoalFocus() { JSONArray jsonArray = new JSONArray(); > jsonArray.put("{\"method\":\"evaluate\","); > jsonArray.put("\"params\":"); > jsonArray.put("[\"goal-focus\",\"cmn\"],"); > jsonArray.put("\"id\":1}"); /print/(jsonArray.getString(0) + > jsonArray.getString(1) + jsonArray.getString(2) + > jsonArray.getString(3)); } > > But I get only the name of the chunk in the goal buffer as output > shown below > > > *{"result": ["NAVIGATION-BEGIN-0"], "error": null, "id": 1}** > **Result: NAVIGATION-BEGIN-0*** > > 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. > > 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). > > Command line: > > 1 > (buffer-chunk goal) > GOAL: NAVIGATION-BEGIN-0 > NAVIGATION-BEGIN-0 > NAVIGATIONSTART"state-1" > NAVIGATIONEND"state-16" > NAVIGATIONCURRENT"state-2" > > Java Code: > > *static void *getBufferChunk() { JSONArray jsonArray = *new *JSONArray(); jsonArray.put(*"{**\"**method**\"**:**\"**evaluate**\"**,"*); jsonArray.put(*"**\"**params**\"**:"*); jsonArray.put(*"[**\"**buffer-chunk**\"**,**\"**goal**\"**],"*); jsonArray.put(*"**\"**id**\"**:1}"*); /print/(jsonArray.getString(0) + jsonArray.getString(1) + > jsonArray.getString(2) + jsonArray.getString(3)); } > > Could you please let me know how to get the values of the slots of the > goal buffer via RPC? > > 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. 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. Hope that helps, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From arunbkris at gmail.com Mon Oct 12 10:26:46 2020 From: arunbkris at gmail.com (Arun Krishna) Date: Mon, 12 Oct 2020 16:26:46 +0200 Subject: [ACT-R-users] Regarding getting the values of the slots of the goal buffer via RPC In-Reply-To: References: Message-ID: Hi Dan, Thank you for the reply. In my case chunk-slot-value returns the slot value defined by add-dm command for example I have an add-dm with (navigation-begin ISA navigation navigationStart "state-1" navigationEnd "state-16" navigationCurrent "state-1") So ? (chunk-slot-value navigation-begin navigationCurrent) "state-1" ? I always get "state-1". But the goal buffer has a different content in the same time which is given below [image: image.png] I was trying to retrieve the value of NAVIGATIONCURRENT slot from the goal buffer which is "state-2" . (Which is the result of a production while running the model) Could you please tell me how to achieve this using RPC? Thanks & Regards, Arun On Mon, Oct 12, 2020 at 2:07 AM Dan Bothell wrote: > > On 10/11/20 12:23 PM, Arun Krishna wrote: > > Hi, > > > Missed to mention "Subject" in the previous mail. Sending the same again > with "Subject" > > > > It would be great if I get some support regarding the RPC for reading the > slot values of the chunk in the goal buffer. > > > > I have a chunk in the goal buffer which has 3 slots and values defined for > each of the slots. > > Via command line I can read using (goal-focus) and I get the output > > > > *(goal-focus) > NAVIGATION-BEGIN-0 > NAVIGATIONSTART "state-1" > NAVIGATIONEND "state-16" > NAVIGATIONCURRENT "state-2"* > > > > There are 3 slots and values (state-1,state-16,state-2) for each of the > slots. > > I was trying to read these values via RPC in my java application > > > > Java code: > > static void getGoalFocus() { JSONArray jsonArray = new JSONArray(); jsonArray.put("{\"method\":\"evaluate\","); jsonArray.put("\"params\":"); jsonArray.put("[\"goal-focus\",\"cmn\"],"); jsonArray.put("\"id\":1}"); *print*(jsonArray.getString(0) + jsonArray.getString(1) + jsonArray.getString(2) + jsonArray.getString(3)); > } > > > > But I get only the name of the chunk in the goal buffer as output shown > below > > > *{"result": ["NAVIGATION-BEGIN-0"], "error": null, "id": 1}* > *Result: NAVIGATION-BEGIN-0* > > > > 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. > > > > 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). > > > > Command line: > > 1 > (buffer-chunk goal) > > GOAL: NAVIGATION-BEGIN-0 > > NAVIGATION-BEGIN-0 > > NAVIGATIONSTART "state-1" > > NAVIGATIONEND "state-16" > > NAVIGATIONCURRENT "state-2" > > > > Java Code: > > *static void *getBufferChunk() { JSONArray jsonArray = *new *JSONArray(); jsonArray.put(*"{**\"**method**\"**:**\"**evaluate**\"**,"*); jsonArray.put(*"**\"**params**\"**:"*); jsonArray.put(*"[**\"**buffer-chunk**\"**,**\"**goal**\"**],"*); jsonArray.put(*"**\"**id**\"**:1}"*); *print*(jsonArray.getString(0) + jsonArray.getString(1) + jsonArray.getString(2) + jsonArray.getString(3)); > } > > > > Could you please let me know how to get the values of the slots of the > goal buffer via RPC? > > > 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. > > 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. > > Hope that helps, > Dan > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 67264 bytes Desc: not available URL: From db30 at andrew.cmu.edu Mon Oct 12 11:37:39 2020 From: db30 at andrew.cmu.edu (db30 at andrew.cmu.edu) Date: Mon, 12 Oct 2020 11:37:39 -0400 Subject: [ACT-R-users] Regarding getting the values of the slots of the goal buffer via RPC In-Reply-To: References: Message-ID: <8FD895610397BA5A2DBACF0E@[172.18.97.193]> --On Monday, October 12, 2020 10:26 AM -0400 Arun Krishna wrote: > > > Hi Dan, > > > Thank you for the reply. > > > In my case chunk-slot-value returns the slot value defined by add-dm command > for example I have an add-dm with > (navigation-begin ISA navigation navigationStart "state-1" navigationEnd > "state-16" navigationCurrent "state-1") > > So > > > ? (chunk-slot-value navigation-begin navigationCurrent) > "state-1" > ? > > > I always get "state-1". > > > But the goal buffer has a different content in the same time which is given > below > > > > [Image: "image.png"] > > > I was trying to retrieve the value of NAVIGATIONCURRENT slot from the goal > buffer which is "state-2" . > (Which is the result of a production while running the model) > > > Could you please tell me how to achieve this using RPC? > > > Thanks & Regards, > Arun > > > > > As your image shows, the chunk in the buffer is not the chunk navigation-begins, but the chunk navigation-begins-0. That is because the buffers always create a new copy of a chunk. To get the value of a slot of a chunk in a buffer you will first need to get the name of the chunk in the buffer, which you can do using one of the commands: buffer-chunk, buffer-read, or for the goal buffer, goal-focus. Dan From arunbkris at gmail.com Mon Oct 12 12:15:37 2020 From: arunbkris at gmail.com (Arun Krishna) Date: Mon, 12 Oct 2020 18:15:37 +0200 Subject: [ACT-R-users] Regarding getting the values of the slots of the goal buffer via RPC In-Reply-To: <8FD895610397BA5A2DBACF0E@172.18.97.193> References: <8FD895610397BA5A2DBACF0E@172.18.97.193> Message-ID: Hi Dan, Thank you very much for the detailed information. Using RPC, I am now able to get the value of the navigationCurrent slot from the chunk in the goal buffer, by following the steps you had mentioned. (From the chunk navigation-begins-0). Thanks & Regards, Arun On Mon, Oct 12, 2020 at 5:37 PM wrote: > > > --On Monday, October 12, 2020 10:26 AM -0400 Arun Krishna < > arunbkris at gmail.com> > wrote: > > > > > > > Hi Dan, > > > > > > Thank you for the reply. > > > > > > In my case chunk-slot-value returns the slot value defined by add-dm > command > > for example I have an add-dm with > > (navigation-begin ISA navigation navigationStart "state-1" navigationEnd > > "state-16" navigationCurrent "state-1") > > > > So > > > > > > ? (chunk-slot-value navigation-begin navigationCurrent) > > "state-1" > > ? > > > > > > I always get "state-1". > > > > > > But the goal buffer has a different content in the same time which is > given > > below > > > > > > > > [Image: "image.png"] > > > > > > I was trying to retrieve the value of NAVIGATIONCURRENT slot from the > goal > > buffer which is "state-2" . > > (Which is the result of a production while running the model) > > > > > > Could you please tell me how to achieve this using RPC? > > > > > > Thanks & Regards, > > Arun > > > > > > > > > > > > As your image shows, the chunk in the buffer is not the chunk > navigation-begins, but the chunk navigation-begins-0. That is > because the buffers always create a new copy of a chunk. To get > the value of a slot of a chunk in a buffer you will first need > to get the name of the chunk in the buffer, which you can do > using one of the commands: buffer-chunk, buffer-read, or for > the goal buffer, goal-focus. > > Dan > -------------- next part -------------- An HTML attachment was scrubbed... URL: