[ACT-R-users] Regarding getting the values of the slots of the goal buffer via RPC
Arun Krishna
arunbkris at gmail.com
Sun Oct 11 12:23:46 EDT 2020
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: <http://mailman.srv.cs.cmu.edu/pipermail/act-r-users/attachments/20201011/539ed3d0/attachment.html>
More information about the ACT-R-users
mailing list