Hi there. I'm new in CLIPS and I'm so lost. This is what I0m trying to do:
I have a group of classes that are subclass of a class named PeliculaSerie, which is subclass of Contingut. I also have a class named ValoracioGenere that contains a symbol with the name of one of the subclasses mentioned before and a symbol who can contain the value "gens". I wanna erase all the subclasses which names match the symbol in Valoracio Genere. Right now I'm doing it using a slot in the subclasses which contains the name of the subclass:
Hi there. I'm new in CLIPS and I'm so lost. This is what I0m trying to do:
I have a group of classes that are subclass of a class named PeliculaSerie, which is subclass of Contingut. I also have a class named ValoracioGenere that contains a symbol with the name of one of the subclasses mentioned before and a symbol who can contain the value "gens". I wanna erase all the subclasses which names match the symbol in Valoracio Genere. Right now I'm doing it using a slot in the subclasses which contains the name of the subclass:
(defrule remove-edatR""
?user <- (object (is-a User) (grauGenere ?grauU)(nomGenere ?nomU));
?program <- (object (is-a Contingut) (nomGenere ?genereP))
(test (and (eq ?grauU gens) (eq ?nomU ?genereP))
=>
(send ?program delete)
)
I would like to remove the slot genereP and use the name of the class to make the compare. Is it possible?
Thank you!
Try this:
(defrule remove-edatR""
?user <- (object (is-a User) (grauGenere ?grauU)(nomGenere ?nomU));
?program <- (object (is-a Contingut))
(test (and (eq ?grauU gens) (eq ?nomU (class ?program))))
=>
(send ?program delete)
)