Re: JESS: Jess JessTab protege
velven wrote: Is this due to the way i have written my rule such that for each agent, atleast (:X-coordinate ?x2&:(>= 1 (abs (- ?x2 ?x1 had to be checked by jess with another 199 agents? or something else? welcome any suggestions to optimise, Thank you for your time Forget my doubts regarding your formulas. For an agent at 'A', you match any other at any of the nine 'X' and at 'A'. As you have written, it's the many pairs that can be combined from 200 facts that cause the slow down. -Wolfgang To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED]
Re: JESS: Jess JessTab protege
(mapclass) (slot-get) (slot-set) as Hal Hildebrand mentioned are functions from JessTab, sorry i wasn't clear in the last post. As part of the project's requirement, i have to to do things this way. since my classes are defined in protege itself and not done with (defclass) the mapping resulted in all slots treated as multislots type. Is there any way to overcome this problem? >The checks resulting from the LHS are exercised each time "object" facts >are asserted or modified. The *firing* of this rule with its simple RHS >isn't the expensive part. So there will be considerable time taken for LHS checks? cause i was under the impression that the rule fires automatically once pattern matches and there was no checking involved actually. >Since you write that X-coordinates are INTEGER, a comparison using >(:X-coordinate ?x2&~?x1) might be a little faster. (But isn't either >x-coordinate differs *or* y-coordinate differs sufficient to warrant the >change of :Behaviour? As it stands now, *both* must differ.) -Wolfgang X X XO X A XO X X XO to make things clearer, what i want is only agents in the X region should trigger the rule with another at A. agents at the O region should not since they are not 1 grid next to agent at A. as such, either x-coordinate differs *or* y-coordinate differs isn't really correct and ?x2&:(>= 1 (abs (- ?x2 ?x1))) covers +1, -1, and 0 which means equal, no? so my rule is for (?x1 differs ?x2 by 1 or equal) AND (?y1 differs ?y2 by 1 or equal) for a total of 9 combinations. perhaps this complexity is causing the slow down? -vel >Is this due to the way i have written my rule such that for each agent, >atleast >(:X-coordinate ?x2&:(>= 1 (abs (- ?x2 ?x1 >had to be checked by jess with another 199 agents? or something else? > >welcome any suggestions to optimise, Thank you for your time > > > > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Jess-JessTab-protege-tf4413854.html#a12648401 Sent from the Jess mailing list archive at Nabble.com. To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED]
Re: JESS: Jess JessTab protege
These are functions provided by the JessTab plugin to Protégé (http://www.ida.liu.se/~her/JessTab/) which allows it to pull in the model you build in Protégé via modeling in OWL or another ontology language and operate on it with Jess. It's billed as a kind of OO extension to Jess and I haven't personally played around with it, but my suspicion is, like pretty much any generated code system, if you want performance you're not going to want to use some thing with a large amount of layers and lots o' layers is kind of inevitable with this kind of system. On 9/11/07 5:51 AM, "Wolfgang Laun" <[EMAIL PROTECTED]> wrote: > velven wrote: > >> Hi everyone, I'm new to Jess and I have some questions >> >> 1) I'm using (mapclass) to map my protege classes into jess, but I found >> > What is (mapclass), please? > >> that the function maps all userdefined slots to be multislots although i >> have set them to be required single cardinality and integer type in protege. >> ie. the generated is (multislot :X-coordinate) when what i need is (slot >> :X-coordinate (type INTEGER)) >> The trouble occurs when i need to get the value to Java and it is identified >> as a list and I cannot use (slot-get) as only the facts were being modified >> during runtime (...slot-set is too costly) >> > What is (slot-get) or (slot-set)? > >> Though conversion is possible, I'm just wondering if theres a better way to >> do it as the conversion seems abit wasteful and costly to my simulation's >> execution. >> >> 2)I have this rule >> >> (defrule moving_aside >> >> ?node1<-(object (is-a Agent)(:NAME ?n1)(:X-coordinate ?x1)(:Y-coordinate >> ?y1)(:Behaviour ?b1&~"move_aside"&~"look_for_leader")) >> ?node2<- (object (is-a Agent)(:NAME ?n2&~?n1)(:X-coordinate ?x2&:(>= 1 >> (abs (- ?x2 ?x1(:Y-coordinate ?y2&:(>= 1 (abs (- ?y2 ?y1) >> => >> >> (modify ?node1 (:Behaviour "move_aside")) >> >> ) >> >> Basically this rule checks for another agent beside it and set its behaviour >> to another state if present. >> According to my test case, though this rule is never fired, its presence >> alone slowed down the simulation with 200 agents. >> > The checks resulting from the LHS are exercised each time "object" facts > are asserted or modified. The *firing* of this rule with its simple RHS > isn't the expensive part. > > Since you write that X-coordinates are INTEGER, a comparison using > (:X-coordinate ?x2&~?x1) might be a little faster. (But isn't either > x-coordinate differs *or* y-coordinate differs sufficient to warrant the > change of :Behaviour? As it stands now, *both* must differ.) > > -Wolfgang > > >> Is this due to the way i have written my rule such that for each agent, >> atleast >> (:X-coordinate ?x2&:(>= 1 (abs (- ?x2 ?x1 >> had to be checked by jess with another 199 agents? or something else? >> >> welcome any suggestions to optimise, Thank you for your time >> >> >> >> > > > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' > in the BODY of a message to [EMAIL PROTECTED], NOT to the list > (use your own address!) List problems? Notify [EMAIL PROTECTED] To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED]
Re: JESS: Jess JessTab protege
velven wrote: Hi everyone, I'm new to Jess and I have some questions 1) I'm using (mapclass) to map my protege classes into jess, but I found What is (mapclass), please? that the function maps all userdefined slots to be multislots although i have set them to be required single cardinality and integer type in protege. ie. the generated is (multislot :X-coordinate) when what i need is (slot :X-coordinate (type INTEGER)) The trouble occurs when i need to get the value to Java and it is identified as a list and I cannot use (slot-get) as only the facts were being modified during runtime (...slot-set is too costly) What is (slot-get) or (slot-set)? Though conversion is possible, I'm just wondering if theres a better way to do it as the conversion seems abit wasteful and costly to my simulation's execution. 2)I have this rule (defrule moving_aside ?node1<-(object (is-a Agent)(:NAME ?n1)(:X-coordinate ?x1)(:Y-coordinate ?y1)(:Behaviour ?b1&~"move_aside"&~"look_for_leader")) ?node2<- (object (is-a Agent)(:NAME ?n2&~?n1)(:X-coordinate ?x2&:(>= 1 (abs (- ?x2 ?x1(:Y-coordinate ?y2&:(>= 1 (abs (- ?y2 ?y1) => (modify ?node1 (:Behaviour "move_aside")) ) Basically this rule checks for another agent beside it and set its behaviour to another state if present. According to my test case, though this rule is never fired, its presence alone slowed down the simulation with 200 agents. The checks resulting from the LHS are exercised each time "object" facts are asserted or modified. The *firing* of this rule with its simple RHS isn't the expensive part. Since you write that X-coordinates are INTEGER, a comparison using (:X-coordinate ?x2&~?x1) might be a little faster. (But isn't either x-coordinate differs *or* y-coordinate differs sufficient to warrant the change of :Behaviour? As it stands now, *both* must differ.) -Wolfgang Is this due to the way i have written my rule such that for each agent, atleast (:X-coordinate ?x2&:(>= 1 (abs (- ?x2 ?x1 had to be checked by jess with another 199 agents? or something else? welcome any suggestions to optimise, Thank you for your time To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED]