Jess71p2 33 - The working memory still thinks our Account's...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
5. Working Memory 25 Jess> (printout t (?a getBalance) crlf) 0.0 Jess> (modify 0 (balance 1)) <Fact-0> Jess> (facts) f-0 (MAIN::Account (balance 1) (class <Java-Object:java.lang.Class>) (OBJECT <Java-Object:Account>)) For a total of 1 facts in module MAIN. Jess> (printout t (?a getBalance) crlf) 1.0 But what happens if we modify the Account directly? Jess> (printout t (?a getBalance) crlf) 1.0 Jess> (?a setBalance 2) Jess> (printout t (?a getBalance) crlf) 2.0 Jess> (facts) f-0 (MAIN::Account (balance 1) (class <Java-Object:java.lang.Class>) (OBJECT <Java-Object:Account>)) For a total of 1 facts in module MAIN.
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The working memory still thinks our Account's balance is 1.0. There are several ways to notify Jess that the object is changed and working memory needs updating. One is using the update function: Jess> (update ?a) Jess> (facts) f-0 (MAIN::Account (balance 2.0) (class <Java-Object:java.lang.Class>) (OBJECT <Java-Object:Account>)) For a total of 1 facts in module MAIN. update tells Jess to refresh the slot values of the shadow fact linked to the given Java object. The reset function, which resets working memory, updates the slots of all shadow facts in the...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern