[ACT-R-users] Question regarding add-dm via RPC

Arun Krishna arunbkris at gmail.com
Fri Sep 11 09:17:21 EDT 2020


Hi,

Good day.

I am facing some issues for adding a new chunk via RPC for my ACT-R model.

I recreated the same using the count model in ACT-R\tutorial\unit1 for
problem description purposes.

I am trying to create a new chunk to the count model.

Through command it works (add-dm (test isa count-order first 1 second 2))

But when I use my java code (given below)

*static void *addChunk() {
  JSONArray jsonArray = *new *JSONArray();
  jsonArray.put(*"{**\"**method**\"**:**\"**evaluate**\"**,"*);
  jsonArray.put(*"**\"**params**\"**:"*);

*//jsonArray.put("[\"add-dm\",\"count\",\"new\",\"isa\",\"count-order\",\"first\",\"5\",\"second\",\"6\"],");
  *jsonArray.put(*"[**\"**define-chunks**\"**,**\"**count**\"**,**\"**new4*
*\"**,**\"**isa**\"**,**\"**count-order**\"**,**\"**first**\"**,5,**\"*
*second**\"**,6],"*);
  jsonArray.put(*"**\"**id**\"**:1}"*);
  *print*(jsonArray.getString(0)
      + jsonArray.getString(1)
      + jsonArray.getString(2)
      + jsonArray.getString(3));
}

I am getting an error in command window

(add-dm (test isa count-order first 1 second 2))

#|Warning: Invalid chunk definition: (TEST ISA COUNT-ORDER FIRST 1 SECOND
2) names a chunk which already exists. |#

NIL

1 >

I am able to use other commands successfully using my java code for example
the goal-focus command as given below.

*static void *setGoalFocus() {  JSONArray jsonArray = *new
*JSONArray();  jsonArray.put(*"{**\"**method**\"**:**\"**evaluate**\"**,"*);
 jsonArray.put(*"**\"**params**\"**:"*);
  jsonArray.put(*"[**\"**goal-focus**\"**,**\"**count**\"**,**\"**first-goal**\"**],"*);
 jsonArray.put(*"**\"**id**\"**:1}"*);  *print*(jsonArray.getString(0)
     + jsonArray.getString(1) + jsonArray.getString(2)      +
jsonArray.getString(3));
}

Could you please tell me what I am  doing wrong in addChunk() function
above?

Thanks & Regards,

Arun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.srv.cs.cmu.edu/pipermail/act-r-users/attachments/20200911/69c7ea44/attachment.html>


More information about the ACT-R-users mailing list