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

Represents the world in which Clarion agents exist.

Namespace: Clarion
Assembly: ClarionLibrary (in ClarionLibrary.dll) Version: 6.1.1.0 (6.1.1.0)

Syntax

C#
public sealed class World

Remarks

In general, the world is defined using World objects. World objects extend the IWorldObject interface. Below are some examples of world objects:
  • The features of all sensory information in the world (in the form of dimension-value pairs)
  • The declarative chunks that semantically define objects in the world
  • The actions that an agent can perform within the world (in the form of action chunks)
  • An agent's goals (in the form of goal chunks), which describe an agent's purpose in the world
  • The time
  • The agents themselves

The World class is a singleton containing a single instance (see Instance) of the World class and several static methods for generating and retrieving (etc.) World objects.

Think of the World singleton object as you would the real world. That is, the world is made up of a lot of little environments, each with it's own unique objects and features. At any given time, a person (or agent) within the world is only experiencing a small piece of the whole world. The piece of the world that is experienced gets determined by those objects or features that are "activated" in sensory information (i.e., what is perceived by the agent).

Caution
World objects are represented differently within the system internals. That is, for all world objects, the World singleton generates a unique GUID (referred to as a World ID). The World ID is accessed (through the static methods of the World class) by the core components of the Clarion Library. Because this internal representation is vitally important to the proper performance of the system, the generation of ALL world objects is performed using the various static "New..." methods in the World class (see examples below). World objects generated using the "New" methods are added to the World singleton (and therefore "exist" within the world) before they are returned.

Copyright 2011. Nicholas Wilson

Examples

Below are some implementation examples of how the World class is used.

Note
The following code samples do not necessarily do anything particularly interesting or useful on their own. These snippets are simply intended as examples of how the World class can be used.

CopyC#
DimensionValuePair dv = World.DimensionValuePair("Dim1", "Val1");
DeclarativeChunk dc = World.NewDeclarativeChunk("Example Chunk");
ExternalActionChunk a = World.NewExternalActionChunk();
a += World.NewDimensionValuePair ("Dim2","Val1");
GoalChunk g = World.NewGoalChunk ();
g += World.NewDimensionValuePair("Dim3","Val2");
Agent john = World.NewAgent("John Doe");

Console.WriteLine(World.Instance);

if(World.GetDimensionValuePair("Dim1","Val1") == dv)
    Console.WriteLine(World.GetAgent("John Doe"));

Inheritance Hierarchy

System..::..Object
  Clarion..::..World

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.

See Also