[This is preliminary documentation and is subject to change.]

This class implements an agent within the CLARION Library

Namespace: Clarion.Framework
Assembly: CLARIONLibrary (in CLARIONLibrary.dll) Version: 6.1.0.7 (6.1.0.7)

Syntax

Remarks

This class acts as the vehicle for actualizing everything related to the initialization and operation of an Agent. All of the capabilities implemented by this class are conceptualized by the CLARION theory. Before attempting to construct an agent using the CLARION Library, you should make sure you have a firm understanding of the CLARION theory. A detailed technical specification for the CLARION theory can be found at http://www.cogsci.rpi.edu/~rsun/clarion-pub.html.

For the most part, initializing an agent is accomplished using either the World singleton or the AgentInitializer. The World is in charge of the creating of an agent, while the AgentInitializer is in charge of initializing the internal (functional) aspects of the agent once it is created. A simple example of how to initialize an agent can be found in the "Examples" section (below). Furthermore, a detailed walkthrough of this example can be found in the "Setting Up & Using the ACS" guide (located in the "Basics Tutorials" section of the "Tutorials" folder). More advanced configuration options can be found in the various other tutorials (see the "Tutorials" folder of the CLARION Library package).

Copyright 2011. Nicholas Wilson

Examples

The cod below is excerpted from the "HelloWorld - Simple.cs" sample (located in the "Beginner" folder under the "Samples" folder of the CLARION Library package)
CopyC#
//Initialize the World
DimensionValuePair hi = World.NewDimensionValuePair("Salutation", "Hello");
DimensionValuePair bye = World.NewDimensionValuePair("Salutation", "Goodbye");

ExternalActionChunk sayHi = World.NewExternalActionChunk("Hello");
ExternalActionChunk sayBye = World.NewExternalActionChunk("Goodbye");

//Initialize the Agent
Agent John = World.NewAgent("John");
SimplifiedQBPNetwork net = AgentInitializer.InitializeImplicitDecisionNetwork(John, SimplifiedQBPNetwork.Factory);

net.Input.Add(hi);
net.Input.Add(bye);

net.Output.Add(sayHi);
net.Output.Add(sayBye);

John.Commit(net);

net.Parameters.LEARNING_RATE = 1;
John.ACS.Parameters.PERFORM_RER_REFINEMENT = false;

//Run the task
SensoryInformation si;
ExternalActionChunk chosen;

for (int i = 0; i < NumberTrials; i++)
{
    si = World.NewSensoryInformation(John);

    //Randomly choose setup the sensory information as either saying "Hello" or "Goodbye"
    if (rand.NextDouble() < .5)
    {
        //Say "Hello"
        si.Add(hi, John.Parameters.MAX_ACTIVATION);
        si.Add(bye, John.Parameters.MIN_ACTIVATION);
    }
    else
    {
       //Say "Goodbye"
       si.Add(hi, John.Parameters.MIN_ACTIVATION);
       si.Add(bye, John.Parameters.MAX_ACTIVATION);
   }

   //Perceive the sensory information
   John.Perceive(si);

   //Choose an action
   chosen = John.GetChosenExternalAction(si);

   //Deliver appropriate feedback to the agent
   if (chosen == sayHi)
   {
       //The agent said "Hello"
       if (si[hi] == John.Parameters.MAX_ACTIVATION)
       {
           //The agent chose the correct response
           John.ReceiveFeedback(si, 1.0);
       }
       else
       {
           //The agent chose the incorrect response
           John.ReceiveFeedback(si, 0.0);
       }
   }
   else
   {
       //The agent said "Goodbye"
       if (si[bye] == John.Parameters.MAX_ACTIVATION)
       {
           //The agent chose the correct response
           John.ReceiveFeedback(si, 1.0);
       }
       else
       {
           //The agent chose the incorrect response
           John.ReceiveFeedback(si, 0.0);
       }
   }
}

//Kill the agent to end the task
John.Die();

Inheritance Hierarchy

System..::..Object
  Clarion.Framework..::..Agent

See Also