# Implementation of DEvelopmentAl Learning (IDEAL) Course

## Implementing learning of regularities of interaction

If you have no interest in programming, you can now proceed to the next page.

Project 3 (files to modify or to add to Project 2)

• main / Main ← Uncomment the instructions to instantiate Existence030 or Existence031.
• existence / Existence030 ← The program that implements the algorithm in Tables 33-1 and 33-2.
• existence / Existence031 ← The program that implements the algorithm in Tables 33-1 and 33-3.
• agent / Anticipation ← An anticipation generated by the method computeAnticipations().
• agent / Anticipation030 ← A simple anticipation based on the afforded interactions.
• agent / Anticipation031 ← A more complex anticipation based on weighted composite interactions.
• coupling / interaction / Interaction030 ← Now, Interactions can be primitive or composite.
• coupling / interaction / Interaction031 ← Interaction031s have a weight.

For Lesson 3, your programming activities are:

• 1. Change Main.java to instantiate Existence030 and run it. Observe that the trace is similar to that in the next page.
• 2. Change Existence030 to instantiate Environment010 instead of Environment030 and run it. Observe that the modified Existence030 also learns to get pleased when it implements Environment010 instead of Environment030.
• 3. Change Main.java to instantiate Existence031 and run it. Observe that it learns to be pleased in Environment031.
• 4. Change Existence031 to instantiate Environment010 and then Environment030 and run it. Observe that the modified Existence031 also learns to be pleased when it implements Environment010, Environment030, and Environment031.

Lesson 3 shows that Existence031 can adapt to three different environments (Environment010, Environment030, Environment031). However, Existence031 will fail in environments that require learning regularities longer than two interaction cycles. Future lessons teach to design agents that can learn and exploit arbitrarily long regularities of interaction.