27: Understanding Agent Fundamentals

  1. An agent is a process that can travel from one place (its origin) to another place (its destination) within the telesphere.
    1. The move from one place to another, initiated by calling "go" on the agent, is called a trip. (Timothy Leary is smiling even now.)
    2. A trip requires a ticket, an object that can specify the agent's destination, means of getting there, permits it desires once there, how long it should take to get there, and what it should do once there.
    3. A trip may involve physical transport between Telescript engines. For example:
      1. WAN connections
      2. The Internet
      3. Infrared connections
      4. Phone lines
      5. Even (at worst) Sneakernet
    4. A trip may fail, leaving an agent stranded at its origin or in a third place.
      1. The agent receives a DestinationUnavailable exception.
      2. It can take corrective action (perhaps go to the directory) or it can ignore the exception and die.
    5. The agent receives a ticket stub as the result of the go operation. The ticket stub is an object that specifies the means of returning to its origin, how constrained the agent was in its actions at the destination, and the agent's original directions on what to do while at the destination.
      1. An agent doesn't need to return unless it brings information back to its origin. It may be terminated when it runs out of time, or simply cease living after it does what it should do.
    6. If an agent must visit more than one place and it doesn't need to visit those places in succession, it can send clones of itself to each place by calling "send" on itself and providing a list of tickets, one for each place.
      1. It may also create new agents, possibly of a different class.
  2. Once an agent is in a place, it can interact with other processes in two main ways:
    1. It has a reference to its place of occupancy, so it can use the features of that place.
    2. It can meet with other agents in that place. A meeting provides references between two agents so they can use each other's features.
  3. Meeting with another agent requires a petition, an object that can specify the class of the agent with which to meet, the telename of the agent with which to meet, and the maximum amount of time to wait for a meeting.
    1. The agent requesting a meeting is the petitioner.
    2. The agent accepting a request for a meeting is the petitionee.
    3. The two meeting agents are called acquaintances.
    4. A meeting may fail because there is no agent that satisfies the petition; or it may fail because a suitable agent declined to meet.
    5. If a meeting succeeds, the two agents acquire references to each other
    6. An agent calls "part" to end a meeting with a single agent or "partAll" to end all meetings it may have with other agents.
  4. Process control
    1. An agent's ability to go or meet depends on its control.
    2. A process can be in full control, partial control, or not in control at all.
      1. Full control
        1. The process is the current process (it's executing right now).
        2. The process's current thread has no frames for foreign operations.
        3. The frame at the bottom of the current thread is for a live operation (in other words, the thread was started for the process's live operation)
      2. Partial control
        1. The process is the current sponsor of the current operation
        2. No frame for a foreign operation is higher on the current thread than the top frame for a domestic operation. In other words, the process is not currently executing a foreign operation.
    3. Determining full or partial control is important if the process is an agent. It can't travel unless it is in full control; and it can't meet unless it's in partial control.

TS Ref - 26 JUN 1996

Generated by the sweat of Mike Boom's brow.