Connection Machine Programming Language

From Connection Machine
Revision as of 05:34, 10 November 2020 by CMSYSOPWIKI (talk | contribs) (→‎What is a signal?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Contents

Introduction to Connection Machine Programming Language

At a very high level, Connection Machine is a concurrent machine. The CMPL is used to specify the concurrent problems to the Concurrent machine. Connection Machine should be considered if the need is to build Network based Digital Transformation projects, IOT or Internet of Everything systems.


What is a Hyperspace?

Presently, systems are built by executing programs that read input, manipulate it and store output. Complex data base structures are designed and programs are written to make these data transformations. Due to the tight input output coupling, the systems built this way (which is all current information systems) are not agile. They do not respond quickly enough to the changes in the business.

Unlike present technology, MasterKube Connection machine based systems is space created by active autonomously operating nodes, that is suspended to each other by signals. The signals, carry information between them. These nodes could represent a device, drone, SKU, order, person, etc. These active nodes influence the neighboring nodes by sending information through these signals. The dynamism of systems in Connection Machine is given by specifying When these signals become active, when the signals disappear or how these signals themselves move thru other signals in this node matrix. Some of these signals are visible to the outside world while other signals are hidden. The state of this system in Connection Machine is the content of the nodes and the connective tissue between them. This can be viewed by observing the open signals. Because of this dynamic nature of this space it is much more than a traditional database, hence the name Hyperspace.

Hyperspace is a autonomous agents matrix, glued together into shape by links.

Some Practical applications
Domain

Hyperspace view

Digital Supply Network (DSN)

Presently supply chain is viewed as a linear product flow Supply chain from producer to the end consumer. But in reality, it is not a chain but is a Supply network. In Connection machine parlance, this supply network is a hyperspace of customers, vendors, producers, SKUs, transporters, distribution centers, etc.

Smart Factory

Smart factory is a network of independently operating work centers, devices, AGVs which come together in a virtual factory hyperspace to form the production process to create a product.


What is a signal?

Signals communicate information between agents. The signals have types. What goes through the signal defines the type and it is defined by actions.

What is mobile scope?

Scope in langauge design is the availabilty of variables in a program. The scope is best explained below

    var scope = "I am global";
      function whatismyscope(){
          var scope = "I am just a local";
          function func() {return scope;}
          return func;
       }
 

When the above code Whatismyscope is executed, it will print "I am just a local". That is because, the variable scope with in the function takes precedence and it will be used. The fact that it depends on the code makes it lexical scoping. The important thing is that these languages have their scope limited to compile time. It is not available at runtime.

Unlike algorthmic programming scope, in Connection Machine, all information in the agent is private by default. It has to be explicitly shared for it to be visible. Sharing is achieved by raising a signal, and generate a name (alternatively called a channel), which is stored in the element of name data type. Having possession of this name will give access. The unique thing about the channel is that it can be moved from agent to agent. This way scope of an agent can be moved from agent to agent hence called mobile scope.

Mobile Scope in Connection Machine

Mobile scope is illustrated with an example in the picture above. As mentioned earlier in Connection machine, all systems are described as a network of agents. In this case, The HR system is a network of employees, HR staff approving payroll and the payroll agent(s). The flow of a new employee being approved for payroll by HR is illustrated in the picture above. The different signals which make this systems are salaryinfo, GetSalaryDetail, Approvepayroll and BeginPayroll. Only signalGetSalaryDetail, carry actual information. The rest of the signals carry the channel (defined as element of type name) GetSalaryDetail and salaryinfo. The system in the picture above is on the right. Additionaly, click here to get the code for building this system

  1. Setup the Initial agent network.

    1. In this case two agents named Ram and John are created. By itself they dont publish anything. But in our system they initialize with two signals i.e GetSalaryDetail and SalaryInfo. Thru GetSalaryDetail, the most sensitive information is passed. It can be hidden so it cannot be publicly discovered by navigating hyperspace. Thru the SalaryInfo, the channel for GetSalaryDetail is passed.

    2. An HR agent is created which approves the employee for payroll. This HR agent has two signals one is to BeginPayroll and the other to Approvepayroll

  2. HR begins the Payroll Process for Ram.

    1. HR uses the signal BeginPayroll to start the payroll process.

    2. HR binds to SalaryInfo of Ram thru the signal BeginPayroll

    3. Thru the bound SalaryInfo or Ram it moves the channel GetSalaryDetail to HR.

  3. HR Approves Payroll.

    1. HR uses the signal Approvepayroll to create a new payroll for Ram.

    2. Through Approvepayroll it sends GetSalaryDetail of Ram.

  4. Gets private information from Ram.

    1. HR uses the signal GetSalaryDetail and connects to Ram to get Name and Salary to Ram.

Mobile scope in MasterKube connection Machine creates safe and secure fluid hyperspace.


What is Element

The elements define the values carried when signal interactions happen. This is similar to parameters or data dictionary in the case of algorithmic programming. When an element is defined it should also mention the type of element. The element name would appear as the label in the screen or in any inter process communication. The elements ensure the type checking at the element level.

Many elements can be defined together and uploaded into the MasterKube Repository. The structure of this file is as follows:

    <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
      <Elements>
         <Element><elementName>Name</elementName><type>string</type> </Element>
         <Element><elementName>age</elementName><type>number</type> </Element>
      </Elements>
 
Element Description
Element components Description
Element Name The element name defines the name of the element. This should be unique otherwise it will throw an error when it is added to the repository. The element name should not have spaces between it.
ElementType The element type gives the type of the element. When the actions interact, the system ensures that the elements passed are type checked only after type checking would the interactions be considered complete. The different types available are
  • string

    The string type accepts string. It takes alpha numerical string. There is no restriction for string

  • date

    The Date type accepts date. It has to be always in the DD/MM/YY format. MasterKube always checks to make sure that the parameter passed is of type date.

  • number

    The element of type number accepts only number. This can take upto size of double i.e. MasterKube always checks to make sure that the parameter passed is of type number. The interaction will not take place if the passed element is not of type number

  • boolean

  • name
    • Creates mobile scope

    • The element of type name allows the system to share actions between processes. This facility of passing of names allows processes to be mobile and leads to process flexibility. For Example if an element is defined as type name with name “approval” then it can carry an action of type approval. This way the action “approval” can be shared between two user workspaces. This allows the system to have controlled movement of processes. Once the name is moved from one process the name cannot be accessed by the source process but the source process can only wait for an interaction. The target process can carry this name from one process to another till the interaction happens on shared name. An application of this is in a typical leave management system. A leave request can trigger an action “approval” which can be shared with the manager workspace. Another application of this is a doctor referral processes, a primary doctor can initiate a referral (in this case a element of type name of name referral) and it can move from primary doctor’s workspace to the referred doctor’s workspace (as each workspace is represented as a processes) till the referral is attended to. This allows for controlled process flexibility without programming for it.

    • MasterKube does not limit the usage of names. I.e it allows circular references to the type name. I.e. it is possible to have a element of type name and it can itself contain the same type. This is not possible to be accomplished in any algorithmic based systems.


What is Action

When signal is interacted with, the Connection machine ensures that the values accepted by it is checked to make sure it is valid. Which values go thru the signal is defined by the action. With out action, there is no signal and without signal there is no acceptance of value to connection machine. The actions define the type checking at the signal level. During interaction the element values move from the action which is the source to the destination

For example an action “ReferNewPatient” and it is defined like

   <Action> 
       <Element>Name</Element>
       <Element>age</Element>
       <ActionName>ReferNewPatient</ActionName> 
       <TellClientCacheDuration>10</TellClientCacheDuration>
       <TellProxyCacheDuration>100</TellProxyCacheDuration> 
       <AskClientCacheDuration>20</AskClientCacheDuration> 
       <AskProxyCacheDuration>200</AskProxyCacheDuration>>
      <ActionName>ReferNewPatient</ActionName>
   </Action>
 

It says that action ReferNewPatient can carry the elements Name and age. On interaction of this action name “ReferNewPatient”, the element Name and age move from source to the target of the interaction. All other values will be ignored.

Action Description
Action components Description
Element

This gives the name of the element. The element should be defined earlier as part of the element repository. The Action checks with the element repository to ensure that the element name exists. At the time of interaction of this action, this element is the carrier of the data and ensures that the type is transmitted appropriately.

Element name userid is a reserved word. This word is used by all actions. When this is used in element tag, then the value that is transmitted during post on this action is stored in the history as the user who did this action. In the event this is unspecified in this action, then ip address from which the request came would be populated here.

Action Name

The action name gives the name of the action which contains these elements. This will appear in the URL.

TellClientCacheDuration

The duration in seconds for which action's Tell data can be stored in the cache of the client. This is an optional field and is unsigned integer. This number get inserted to the HTTP header when the response is generated.

TellProxyCacheDuration

The duration in seconds for which action's Tell data can be stored in the cache of a proxy and served directly to requesting clients without re-validation at the server. This is an optional field and is unsigned integer. This number get inserted to the HTTP header when the response is generated.

AskClientCacheDuration

The duration in seconds for which action's Tell data can be stored in the cache of the client. This is an optional field and is unsigned integer. This number get inserted to the HTTP header when the response is generated.

AskProxyCacheDuration

The duration in seconds for which action's Askdata can be stored in the cache of a proxy and served directly to requesting clients without re-validation at the server. This is an optional field and is unsigned integer. This number get inserted to the HTTP header when the response is generated.


What is a Agent?

An agent is autonomous or independent, as only it can decide what signals to give out based on how the agent behavior is defined. The agents express their state and its interconnections thru signals. These agents interact with each other to move the process forward. The agent defines the dynamic part of the system.

The independent nodes on the hyperspace is what agents are. In MasterKube connection machine, it is the basic active component. It has the following purposes.

  • When an agent is created in MasterKube connection machine it creates a New node on hyperspace.
  • It forms links with neighboring Agents. Which agents it forms links with becomes its neighbor
  • It also specifies behavior that needs that is reusable. Common configuration and signal operators can be packaged into a agent so it can be excited to give reusability.
  • Agents is capable of doing arithmetic and decision.
  • Finally the most important of all, it is able to send links on existing links. This way it can alter its neighbors and there by shape of the hyperspace.

With the agents capabilities as mentioned above; Complex relationships like workflow, sharing, containment, aggregation relationships can be built. The state of the process is the state of all the agents and their interconnections. These are exposed as REST urls and can be navigated by any system. The agent is activated by the configuration operator Agent Command

Agent Syntax

To define an agent it is necessary to say what space in the hyperspace it is creating and what data and connections are being passed to it. Also it defines what the different dynamic actions are and they are composed of signal operators and configuration operators. A sample of the agent syntax is given below

 <?xml version="1.0" encoding="UTF-8"?>
   <Agent>
     <AgentName>CreateInvoiceProcessAgent</AgentName>
	<!--to create an invoice, view, to know from where its comming from and provide the type of invoice functionalities accordingly--> 	
	<ProcessName>Invoice</ProcessName>
	<AvatarName>InvoiceNumber</AvatarName>
	   <Element>InvoiceNumber</Element>
	   <Element>InvoiceDate</Element>
	   <Element>WhichCustomerforInvoice</Element> 
	   <Element>GSTNumber</Element> 
	   <Element>FromWhereisthisInvoiceBeingCreated</Element> 
	 
	<Compose>
	    <Tell> <element> <elementName>FromWhereisthisInvoiceBeingCreated</elementName> </element>  </Tell>
	    <AgentCommand> <AgentName>MovingFirstSupplyChargeAgent</AgentName> </AgentCommand>
	    <AgentCommand> <AgentName>LinkPlaceOfSupplyToInvoiceAgent</AgentName> </AgentCommand>
	    <AgentCommand> <AgentName>LinkPlaceOfBillingToInvoiceAgent</AgentName> </AgentCommand>
            <AgentCommand> <AgentName>WhichInvoiceAgent</AgentName> </AgentCommand><!--for dropdown-->
	    <AgentCommand> <AgentName>UploadInvoiceFileAgent</AgentName> </AgentCommand>			
	    <Choice>
		<ChoiceOption>
		   <Ask> <action> <actionName>PostInvoice</actionName> </action> </Ask>
			<OptionAction>
			   <Compose> 
			     <AgentCommand> <AgentName>AggregationAgent</AgentName> </AgentCommand> 
			    </Compose>
			 </OptionAction>
		</ChoiceOption>
	     </Choice>	  
	  </Compose>
	</Agent> 
 

The above code is a definition for an autonomous agent which occupies the space Invoice identified by the name InvoiceNumber which is passed to this agent thru the Element tag. The body of the agent consists of many configuration operators and signal operators as defined above.

 <?xml version="1.0" encoding="UTF-8"?>
   <Agent>
     <AgentName>CreateInvoiceProcessAgent</AgentName> 
	 
	<Compose>
	    <Tell> <element> <elementName>FromWhereisthisInvoiceBeingCreated</elementName> </element>  </Tell>
	    <AgentCommand> <AgentName>MovingFirstSupplyChargeAgent</AgentName> </AgentCommand>
	    <AgentCommand> <AgentName>LinkPlaceOfSupplyToInvoiceAgent</AgentName> </AgentCommand>
	    <AgentCommand> <AgentName>LinkPlaceOfBillingToInvoiceAgent</AgentName> </AgentCommand>
            <AgentCommand> <AgentName>WhichInvoiceAgent</AgentName> </AgentCommand><!--for dropdown-->
	    <AgentCommand> <AgentName>UploadInvoiceFileAgent</AgentName> </AgentCommand>			
	    <Choice>
		<ChoiceOption>
		   <Ask> <action> <actionName>PostInvoice</actionName> </action> </Ask>
			<OptionAction>
			   <Compose> 
			     <AgentCommand> <AgentName>AggregationAgent</AgentName> </AgentCommand> 
			    </Compose>
			 </OptionAction>
		</ChoiceOption>
	     </Choice>	  
	  </Compose>
	</Agent> 
 

The above code the process name is missing so it becomes as the same node that it got activated in.

Agent Definition
Tags Description
AgentName

Agent Name defines the name of the agent when it is activated. This can be different from the file name. What the system looks for to identify an agent is this name. In the above case the agent name is CreateInvoiceProcessAgent. The agent command signal will have this name.

ProcessName

This is an optional field. If the process name is not specified then the agent adopts the same hyperspace where it is currently activated If the process name is specified then it tells the Connection Machine what this agent is a different node in the hyperspace. Presence of this tag, says what process name to apply in the signal space naming. So in the above case, Invoice would be used in the process name of the signal pattern in URL.

Element

When an Agent is created, it needs to be initialized with some parameters. This can be supplied by the activating Agent command. This can consist of any element defined in the elements repository. By passing signals of type name then this newly created agent can communicate with the agent that spawned it.

AvatarName

When an Agent is created, it is uniquely identified in the hyperspace. But to give it a application relevance this node or autonomous agent can be given a avatar name. So in the above case, the Invoice agent would be identified by the invoice number. This can be a name that is passed from the originating agent.


What is an Operator

Systems on connection machine is defined by signals and what signals open up when signals interact. It is operators that define what signals open when a particular signal is interacted with. There are two kinds of operators. They are a) Signal operator and b) Configuration operator. Signal operators turns on a URL and sets up interactions. Where as Configuration operators define which signals are open given an interaction.


What is a signal Operator

The action just defines what the action name is and what values and its types will come through that action. It is the signal that gives the expression to an action in the connection machine. So if an action has to be turned into a signal or connection on which a person or machine can interact with it, it is done by signal operator. Signal can be of two types it is either a Tell or Ask. The Ask signal is a connection which can be experienced by a person or a machine into which data can be entered. It is a way by which data can be entered into Connection Machine. The Tell signal is a connection which can be experienced thru which connection machine send out data. Both these signals are exposed as hypertext (REST URL). Connection machine when it encounters a Ask and Tell of the same action name will bind moving the process forward.

In summary Signal operators convert the action into a signal which is expressed from the connection machine as a URL. This URL is unique Connection Machine wide Nonce. Once interacted, this signal name will not appear again. If the Connection machine is hooked up to the Internet then Signal is a Internet wide nonce.


Tell Operator

The “Tell” operator publishes a signal using the action name provided. The elements that were specified in the action will be outputted through this signal. If the signal has a element that is a element, then it will be exposed as a URL pointing to this agent or to another autonomous agent. From a observer outside the Connection Machine, it is signal that can be only read. It cannot be interacted with.

A signal can also be generated but hidden. The advantage with this is that, the signal can be shared privately with others. The request and reply for a Tell signal is as follows

The request

 http://localhost:8080/MasterKube-Application/MasterKube/general/masterkube/User/Helloworld2/HelloWorldActionOutput/1/Tell
 

The reply for a Tell signal is shown below as XML and on console

Tell signal appearance on console

   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <TellSchema>
      <Element>
        <Name>HelloworldName</Name>
        <Type>string</Type>
        <Value>Jesus</Value>
      </Element>
     </TellSchema>
 

The Tell signal is of two types one is Tell signal with action and the other is Tell signal with a element. There are fundamental differences how this will be used. Each will be explained as and when each of them are addressed


Tell Operator with Action

The Tell signal with action is used when a new signal has to be generated. So for example to show the example, a Tell on HelloWorldActionOutput, will generate a new URL. The signal generated with be unique URL.

The complete Tell operator that is public is as follows

    <Tell> <action> <actionName>HelloWorldActionOutput</actionName> </action></Tell>
 
Tell Operator with Action Internal

There will be times when signal has to be generated but it should not be made public but is available when it is interacted directly with the complete name. That can be done by turning on Internal as true. This is especially useful to control privacy and security.

The Tell operator that is hidden is given below

    <Tell> <action> <actionName>HelloWorldActionOutput</actionName> </action> <internal>true</internal></Tell>
 

Tell Operator with element

The Tell with action as mentioned earlier generates a new signal complete with new URL. But if the need is to access a particular signal then it can be done by possessing the access or name to that signal. Imagine there is an Ask action that is hidden that needs to be turned off. That can be turned down by using Tell operator with an element.

The complete Tell operator with element is as follows

    <Tell> <element> <elementName>DenySignal</elementName> </element> </Tell>
 

When the connection machine encounters this operator, it will take the signal name in the DenySignal and publish it and turn off any complementary signals that exist (an Ask).

Ask Operator

The “Ask” operator publishes a signal using the action name provided. The elements that were specified in the action will be outputted through this signal. This signal will allow the users to enter data. If the signal has a element then all autonmous agents that have that action will be shown so it can picked up on the console. From a observer outside the Connection Machine, it is signal that can be used to input data.

A signal can also be generated but hidden. The advantage with this is that, the signal can be shared privately with others. The request and reply for a Ask signal is as follows

The request

http://localhost:8080/MasterKube-Application/MasterKube/general/masterkube/User/Helloworld2/HelloWorldAction/6/Ask
 

The reply for a Ask signal is shown below as XML and on console

Tell signal appearance on console

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <AskElements>
     <Element>
        <Name>HelloworldName</Name>
        <Type>string</Type>
        <elementValue>Jesus</elementValue>
     </Element>
   </AskElements>
 

The Tell signal is of two types one is Tell signal with action and the other is Tell signal with a element. There are fundamental differences how this will be used. Each will be explained as and when each of them are addressed


Ask Operator with Action

The Ask signal with action is used when a new signal has to be generated. So for example to show the example, a Ask on HelloWorldAction, will generate a new URL. The signal generated with be unique URL.

The complete Ask operator that is public is as follows

    <Ask> <action> <actionName>HelloWorldAction</actionName> </action></Ask>
 
Ask Operator with Action Internal

There will be times when signal has to be generated but it should not be made public but is available when it is interacted directly with the complete name. That can be done by turning on Internal as true. This is especially useful to control privacy and security.

The Tell operator that is hidden is given below

    <Ask> <action> <actionName>HelloWorldAction</actionName> </action> <internal>true</internal></Ask>
 

Ask Operator with element

The Ask with action as mentioned earlier generates a new signal complete with new URL. But if the need is to access a particular signal then it can be done by possessing the access or name to that signal. Imagine there is an Tell action that is hidden that needs to be turned off. That can be turned down by using Ask operator with an element.

The complete Ask operator with element is as follows

    <Ask> <element> <elementName>DenySignal</elementName> </element> </Ask>
 

When the connection machine encounters this operator, it will take the signal name in the DenySignal and publish it. The Connection Machine seeing the complementary between the ASK and TELL of DenySignal will turn off the complementary signals that exist (a Tell).

What is a Configuration Operator?

The signal operator by itself only sets up signals for interactions. The signal operators make an action observable on either a User Interface or for other computers in a computer to computer interaction. It does not say how the signaling or behaviour patterns are organized. I.e. it does not say which signals should be observed when a particular signal is interacted with. The configuration operators define system behavior.

The different configuration operators are

  • Sequence
  • Compose
  • Choice
  • Replicate.
  • Agent
  • Timer
  • Arithmetic

Sequence Operator

When two signal operators are combined in a sequence, then it first presents the first signal and on Interaction with that signal, the next signal is made observable. An example of this is given below

 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
  <Sequence>
   <Ask><action><actionName>LeaveRequest</actionName></action></Ask>
   <Tell><action><actionName>LeaveAccepted</actionName></action></Tell>
  </Sequence>
 

In the above case, it first publishes the signal LeaveRequest on Interaction with that, it publishes the next LeaveAccepted signal. So the sequence block arranges signals and there by process movement. To represent complex signalling sequences, this can also be composed with other configuration operators.

Sequence operator components
Components Description
Tell

When Connection machine encounters this Tell signal operator in a Sequence operator, it publishes this signal and waits for it to be interacted with before it moves to the next component in the Sequence.

Ask

When Connection machine encounters this Ask signal operator in a Sequence operator, it publishes this signal and waits for it to be interacted with before it moves to the next component in the Sequence.

Sequence

When it encounters a sequence with in a sequence the connection machine serializes the two sequences. I.e it it will wait for the complete sequence to be complete before the earlier sequence continues.

Compose

If a COMPOSE is defined inside a sequence, then all the actions which are specified in the compose are exposed at the same time.

Choice

If a Choice operator is encountered in the Sequence operator, then the choices are presented first and then the actions within the selected choice is done and only then the further actions within the Sequence is exposed

Replicate

If a Replicate operator is encountered in the Sequence operator, then the next action in the sequence is operated only after all the actions in the Replicate operator are interacted away.

Agent Command

Agent Command is mainly used to call the agent to perform signals based on the Ask and Tell signaling operators. It triggers the signals from the specified agent define inside this AgentCommand. The next operator in the Sequence is exposed only after all the signals in this agent are interacted away.

ArithmeticAgentCommand

It is useful for calculating mathematical expressions by means of agents. The next operator in the Sequence is exposed only after the arithmetic action in ArithmeticAgent is complete.

Timer

Timer gets the system time and generates timer events for processes.


Compose Operator

Compose operator is used to publish multiple signals at the same time. I.e if there are two signal in a compose operator, and then both of those signals would be available for interaction simultaneously. If these signals are tied to other autonomous agents, then this compose operator tells those agents to continue.

   <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
     <Compose>
       <Tell><action><actionName>StockSummary</actionName></action></Tell>
       <Tell><action><actionName>BillSummary</actionName></action></Tell>
     </Compose>
 

In the above case, it publishes the signal StockSummary and BillSummary simultaneously. To represent complex signalling sequences, this can also be composed with other configuration operators. The Compose operator could contain either signaling operators (Ask/Tell). Or it could either contain configuration operators (Sequence, Choice, Compose and replicate operators)

Compose operator components
Components Description
Tell

When Connection machine encounters this Tell signal operator in a Compose operator, it publishes this signal immediately.

Ask

When Connection machine encounters this Ask signal operator in a Sequence operator, it publishes this signal immediately..

Sequence

When it encounters a sequence with in a compose the connection machine the first operation would be exposed for interaction. On that being interacted, the next action in the Sequence would be exposed. It is as though the Sequence is running independently till the end of the sequence.

Compose

If a COMPOSE is defined inside a compose, then all the actions which are specified in the compose are exposed at the same time.

Choice

If a Choice operator is encountered in the compose operator, then the choices are presented first and then the actions within the selected choice is done concurrently with all things in this compose operator.

Replicate

If a Replicate operator is encountered in the Compose operator, then structure under the replicate is created and those actions in the replicate are exposed.

Agent Command

Agent Command is mainly used to call the agent to perform actions based on the Ask and Tell signaling operators. It triggers the actions from the specified agent define inside this AgentCommand.

ArithmeticAgentCommand

It is useful for calculating mathematical expressions by means of agents. When Arithmetic agent command is encountered, the artimenttic operation is activated immediately.

Timer

Timer gets the system time and generates timer events for processes.


Choice Operator

In present day programming, switch statement or if statement makes decisions in programs. Depending on the true and false nature of the condition statement either the true or the false part of the statement operates.

   a = 200
   b = 33
     if b > a:
       print("b is greater than a")
      elif a == b:
       print("a and b are equal")
      else:
       print("a is greater than b")
  

In the above case, the program will print "a is greater than b". and it will stop.

Unlike present systems, like above, which are algorithmic decision makers. The decision making in Connection Machine Programming Langauge is specifying many choices which the observer can see. But only take only one option. So for the example in the code below. The observer is provided with a choice of ApproveCasualLeave and DenyCasualLeave. The observer is allowed to take only one action. So if the signal ApproveCasualLeave is chosen then the signal CasualLeaveApproved is raised. If the signal DenyCasualLeave is taken then the signals LeaveMoreInfo and CasualLeaveDenied are raised one after the other in sequence.

	
    <Choice>
      <ChoiceOption>   
        <Ask> <action> <actionName>ApproveCasualLeave</actionName> </action> <internal>true</internal></Ask>  
        <OptionAction> 
	    <Compose> 
	       <Tell> <action> <actionName>CasualLeaveApproved</actionName> </action> 
	    </Compose> 
         </OptionAction>
	</ChoiceOption> 
	<ChoiceOption>
	  <Ask> <action> <actionName>DenyCasualLeave</actionName> </action> <internal>true</internal></Ask> 
	  <OptionAction>
	      <Sequence>
		<Tell> <action> <actionName>LeaveMoreInfo</actionName> </action> <internal>true</internal> </Tell>
		<Tell> <action> <actionName>CasualLeaveDenied</actionName> </action>
	      </Sequence> 
	   </OptionAction>
	</ChoiceOption>
      </Choice>
 

The option action in a choice can contain any combination of configuration and signal operators.
The code below shows when a choice operator has no response no matter what option is chosen. For eg. when the code below is encountered by Connection Machine, it presents to the observer CasualLeaveApprovals and ShutOffCasualLeaveApprovals. As there are no signal sequences after that, it responds with empty agent with no signals. If an agent has no more signals then agent will disappear from Connection Machine.

	  
    <Choice>
      <ChoiceOption>  
	<Tell> <action> <actionName>CasualLeaveApprovals</actionName> </action></Tell> 
	<OptionAction> </OptionAction>
      </ChoiceOption>
      <ChoiceOption>
        <Ask> <action> <actionName>ShutOffCasualLeaveApprovals</actionName> <internal>true</internal> </action></Ask>
	<OptionAction></OptionAction>
       </ChoiceOption>
    </Choice>
 

If you notice the signal ShutOffCasualLeaveApprovals is hidden so it cannot be seen by an observer. To the observer only signal observed would be CasualLeaveApprovals. But in actuality, it has a hidden link to some other to some other agent or this agent itself. This surprising behaviors can be configured to build very engaging experiences.


Arithmetic Agent Operator

Existing algorithmic programs evaluate an expression and the output of the arithmetic operation is stored in variable in storage. Unlike the sequential computation Connection Machine works by communications so the way arithmetics operate is different. In Connection machine, the right hand side of the operators are open as ASK signals and only on binding the expression is evaluated. On evalutation the Right hands side is expressed as a Tell signal

Expression Hard cored

The arithmetic expression to be evaluated is given in the tag “AgentExpression”, on triggering this agent, the variables in the right hand side would be exposed as ASK actions. On binding of all these variables the arithmetic expression is evaluated and the answer i.e. the right hand side is exposed as TELL action.

   <ArithmeticAgentCommand>
    <AgentExpression> orderamount=ordertotal+tax </AgentExpression>
   </ArithmeticAgentCommand>
  

In the above case, when the agent is activated, the ordertotal and tax as exposed as ASK action. On binding of ordertotal and tax the right hand side i.e the orderamount is evaluated. On evaluation, the orderamount is exposed as a TELL action. An ask can bind on this to continue the processing.

Dynamic Expression from action

The earlier version of arithmetic agent, the expression was hard wired. Now there will be times when the arithmetic expression has to be loaded at runtime. It is then this method is used.

   <ArithmeticAgentCommand>
    <ActionName> invoicetotalexpression </ActionName>
   </ArithmeticAgentCommand>
  

In the above case, when the arithmetic agent on activating, Raises an ASK signal with name in the ActionName tag in the arithmetic expression. So for example, in the case below, “Invoicetotalexpression” signal is raised as ASK signal.A process can now inject arithmetic expression through this exposed action, using a complementary “Invoicetotalexpression” TELL signal. This expression is evaluated like in the earlier case and the output TELL for the right hand side of the expression is generated. In the event that the passed expression is not valid then it raises a “ValidationError” TELL signal

computation is communication.

Agent Operator

The agent command operator is used to initiate an agent. Some agents have input parameters to instantiate the agent. The others dont have any input parameters. Both of these can be spawned with this agent operator.

   <AgentCommand> <AgentName>LeaveApprovalAgent</AgentName></AgentCommand>  
 

The above agent command spawns the agent LeaveApprovalAgent with no movement of parameters.

   <AgentCommand>
     <AgentName>CasualLeaveApprovalAgent</AgentName>
     <Ask> <action> <actionName>TriggerMgrCLApprove</actionName> </action> <internal>true</internal> </Ask>
   </AgentCommand>
 

The above agent command spawns the agent LeaveApprovalAgent. But this will happen only when an interaction happens on TriggerMgrCLApprove. On triggering TriggerMgrCLApprove, it passes all the parameters that is in this action to the agent LeaveApprovalAgent.

Decision Agent Operator

The purpose of this agent is to arrive at a decision and drive processes. Unlike all other agents we mentioned before, this can be inserted anywhere in the overall process. This can be composed to create to make decisions. Imagine a set of rules that need to be evaluated all the time in a process, to make sure the process is consistent. This tag can be used to create that. This can also be composed to create a decision agent, which gets executed all the time to keep the overall process complete and valid.

For example in a real world, take an example of a sales order. This order when it is entered need to go through a credit check to ensure that the product is not shipped to people who cannot pay. The decision can be used as a sentinel, to ensure that no orders leave to people who are unable to pay. A simple decision can be included in the overall process, so that it is periodically checked, to ensure that the order amount does not increase more than the approved amount. This will ensure such a error does not happen anytime in the system. This way even when the order is changed to increase the quantity, the amount would be checked and if it is more than the set amount, the decision would fire alerting the credit department.

The overall structure of the code is below:

   <Decision>
     <Expression>Age==16</Expression>
        <TrueEvent><Ask><action><actionName>Sweet16</actionName></action></Ask></TrueEvent>
        <FalseEvent><Tell><action><actionName>Gottcha</actionName</action></Tell></FalseEvent>
   </Decision>
 

The above code can be interspersed anywhere in the code to create a decision. Or it can be combined into an agent which can be triggered at anytime, simplifying and centralizing the overall decisions.

Decision Agent operator components
Components Description
Expression

The expression is the normal logical expression. The variables that need value gets published to the interaction space and this needs to be provided. On all the values arriving, the decision expression is evaluated. If the expression is turned true, then the true action is executed. Otherwise the falseaction is executed. So for example in the above case, age == 16, ensures that the age is published as an ask signal, which when arrives, is consumed by the decision to complete the decision execution.

The different possibilities are:

Age==16 Evaluates Age = 16
MyAge<=18&YourAge==20 Evaluates Myage<=18 and YourAge = 20
(!((!(Number1<7))&(!(Number2<20)))) Evaluates Not of Number1 not less than 7 and Number2 not less than 20
Maths>=50&Physics>60&Chemistry>70 Evaluates Maths>=50 and Physics>60 and Chemistry>70

TrueEvent

This is the true event. This canhave any ASK or TELL signal. So in the example below it triggers a “UnderAge” action.
<TrueEvent>

<Ask><action><actionName>UnderAge</actionName></action></Ask>

</TrueEvent>

FalseEvent

This is the true event. This canhave any ASK or TELL signal. So in the example below it triggers a “UnderAge” action.
<TrueEvent>

<Ask><action><actionName>OverAge</actionName></action></Ask>

</TrueEvent>


Timer Agent Operator

The Timer agent is a service offered by MasterKube to trigger signals at defined date. This can be used to trigger signals to different process. For example this can be used to signal a arrival of a patient on a specific date. It gets the system time and generates timer events. It has only two properties called SignalActionName and DateElementName. The syntax of the timer agent is given below.

    <Timer>
         <Ask><action><actionName>Schedule</actionName></action></Ask>
         <DateElementName> StartDate </DateElementName>
    </Timer>
 

This is for a ASK signal. On the specified time mentioned in the DateElementName triggers the ask signal “Schedule” on that date.

    <Timer>
         <Ask><action><actionName>Schedule</actionName></action></Ask>
         <DateElementName> StartDate </DateElementName>
    </Timer>
 

This is for a TELL signal. On the specified time mentioned in the DateElementName triggers the tell signal “Schedule” on the start date.

Replicate Operator

Replicate operator

Interaction Experiences

The power of Connection machine is the capability of the language to express complex interaction experience sequences. By combining the configuration and signal operators in different combinations complex cause effect situations can be organized. Given below are some sample situations. This is explained as a pictorial representation along with independent paths that a interaction path can take.

Presently, computers cause effect relationship is simulated by using complex status codes and controlling the code through these states. This differentiates the Connection machine from all the algorithmic machines so far. By using combination of these signal operators and combining them with configuration operators for the first time in computing it is possible to create cause effect relationships directly. The list of interaction experiences in this list are not exhaustive. These are mentioned to give the reader the power of MasterKube Connection Machine. More will be added as and when more are discovered.

Compose

Every operation within compose will be in the same level. The parent for all the operations will be the same.

Tell signal appearance on console

   <Compose>
     <Tell> <action> <actionName>A</actionName> </action> </Tell>
     <Tell> <action> <actionName>B</actionName> </action> </Tell>
   </Compose>
  

The independent experience paths that will be experienced by the observer are:

  • A
  • B


Compose within Compose

When a compose is composed in another compose it is a complete compose. i.e all signals are rasied at the same time.

Compose in Compose
 
     <Compose>
        <Compose>
           <Tell> <action> <actionName>A</actionName> </action> </Tell>
           <Tell> <action> <actionName>B</actionName> </action> </Tell>
         </Compose>
            <Tell> <action> <actionName>C</actionName> </action> </Tell>
        <Compose>
           <Tell> <action> <actionName>D</actionName> </action> </Tell>
           <Tell> <action> <actionName>E</actionName> </action> </Tell>
         </Compose>
       </Compose> 
 

The independent experience paths are :

  • A
  • B
  • C
  • D
  • E


Sequence

When two signals are in sequence then the first signal is raised on interaction with the first one the second one is raised.

Sequence
 
   <Sequence>
      <Tell> <action> <actionName>A</actionName> </action> </Tell>
      <Tell> <action> <actionName>B</actionName> </action> </Tell> 
   </Sequence>
 

The independent experience paths are :

  • A->B


Sequence with in sequence

Two composed sequences is as good as having one big sequence operator.

Sequence in Sequence
 
   <Sequence>
     <Sequence>
       <Tell> <action> <actionName>A</actionName> </action> </Tell>
       <Tell> <action> <actionName>B</actionName> </action> </Tell> 
     </Sequence>
      <Tell> <action> <actionName>C</actionName> </action> </Tell> 
   </Sequence>
 

The independent experience paths are :

  • A->B->C


Sequence within a Compose

A sequence when it is composed with two signal operators are given below

Sequence in Sequence
 
   <Compose>
       <Tell> <action> <actionName>A</actionName> </action> </Tell>
     <Sequence>
       <Tell> <action> <actionName>B</actionName> </action> </Tell>
       <Tell> <action> <actionName>C</actionName> </action> </Tell> 
     </Sequence>
      <Tell> <action> <actionName>D</actionName> </action> </Tell> 
   </Compose>
 

The independent experience paths are :

  • A
  • B->C
  • D


Composition of many Sequences

When two sequence are composed then it creates 3 different independent experience paths.

Two sequences in Compose
 
   <Compose>
     <Sequence>
       <Tell> <action> <actionName>A</actionName> </action> </Tell>
       <Tell> <action> <actionName>B</actionName> </action> </Tell>
     </Sequence>
       <Tell> <action> <actionName>C</actionName> </action> </Tell> 
     <Sequence>
      <Tell> <action> <actionName>D</actionName> </action> </Tell>
      <Tell> <action> <actionName>E</actionName> </action> </Tell> 
     </Sequence>
   </Compose>
 

The independent experience paths are :

  • A->B
  • C
  • D->E


Sequence of signal and Compose operators

When signal operators are composed with in a sequence.

Compose with in a sequence
   <Sequence> 
         <Tell> <action> <actionName>A</actionName> </action> </Tell>
       <Compose>
         <Tell> <action> <actionName>B</actionName> </action> </Tell>
         <Tell> <action> <actionName>C</actionName> </action> </Tell> 
       </Compose> 
         <Tell> <action> <actionName>D</actionName> </action> </Tell> 
     </Sequence> 
 

The independent experience paths are :

  • A->B->D
  • A->C->D


Sequence of many compose operators and signal operators

When two compose configuration operators are sequenced .

Compose with in a sequence
   <Sequence>  
       <Compose>
         <Tell> <action> <actionName>A</actionName> </action> </Tell>
         <Tell> <action> <actionName>B</actionName> </action> </Tell> 
       </Compose> 
         <Tell> <action> <actionName>C</actionName> </action> </Tell> 
       <Compose>
         <Tell> <action> <actionName>D</actionName> </action> </Tell>
         <Tell> <action> <actionName>E</actionName> </action> </Tell> 
       </Compose> 
     </Sequence> 
 

The independent experience paths are :

  • A->C->E
  • A->C->D
  • B->C->D
  • B->C->E


Composed to sequence operator and signal operator

Composition of a sequence operator with two signal operators.

   <Compose>  
         <Tell> <action> <actionName>A</actionName> </action> </Tell>
           <Sequence>
            <Tell> <action> <actionName>B</actionName> </action> </Tell>
              <Compose>
                <Tell> <action> <actionName>C</actionName> </action> </Tell>
               <Tell> <action> <actionName>D</actionName> </action> </Tell> 
              </Compose>
            <Tell> <action> <actionName>E</actionName> </action> </Tell>  
           <Sequence> 
         <Tell> <action> <actionName>F</actionName> </action> </Tell>
     </Compose> 
 

The independent experience paths are :

  • A
  • B->C->E
  • B->D->E
  • F


Choice operator

In a choice, depending on the choice taken by the observing agent, the specific of that sequence will be followed. The Option commands (TELL / ASK) will be wrapped in one option node so that if one option command is bind, the other option operations are removed. The action commands for the option bind only are exposed.

   <Compose>  
      <Choice>
       <ChoiceOption>   
        <Tell> <action> <actionName>A</actionName> </action> </Tell>  
        <OptionAction> 
	    <Compose> 
	       <Tell> <action> <actionName>C</actionName> </action> 
	       <Tell> <action> <actionName>D</actionName> </action> 
	    </Compose> 
         </OptionAction>
	</ChoiceOption> 
	<ChoiceOption>
	  <Tell> <action> <actionName>B</actionName> </action> </Tell> 
	  <OptionAction>
	      <Sequence>
		<Tell> <action> <actionName>E</actionName> </action> </Tell>
		<Tell> <action> <actionName>F</actionName> </action> </Tell>
	      </Sequence> 
	   </OptionAction>
	</ChoiceOption>
      </Choice>
        <Tell> <action> <actionName>G</actionName> </action> </Tell>  
     </Compose> 
 

The independent experience paths are :

  • A->C
  • A->D
  • B->E->F
  • G


Choice Operator and signal operator in Sequence.

The whole choice is in sequence with two signal operations. The two signal operations will only be triggered after the choice is completely done.

   <Sequence>  
      <Choice>
       <ChoiceOption>   
        <Tell> <action> <actionName>A</actionName> </action> </Tell>  
        <OptionAction> 
	    <Sequence> 
	       <Tell> <action> <actionName>C</actionName> </action> 
	       <Tell> <action> <actionName>D</actionName> </action> 
	    </Sequence> 
         </OptionAction>
	</ChoiceOption> 
	<ChoiceOption>
	  <Tell> <action> <actionName>B</actionName> </action> </Tell> 
	  <OptionAction>
	      <Compose>
		<Tell> <action> <actionName>E</actionName> </action> </Tell>
		<Tell> <action> <actionName>F</actionName> </action> </Tell>
	      </Compose> 
	   </OptionAction>
	</ChoiceOption>
      </Choice>
        <Tell> <action> <actionName>G</actionName> </action> </Tell> 
        <Tell> <action> <actionName>H</actionName> </action> </Tell>  
     </Sequence> 
 

The independent experience paths are :

  • A->C->D->G->H
  • B->E->G->H
  • B->F->G->H


Complex Choice Operator and signal operator in parallel.

The whole choice is in sequence with two sig.

   <Compose>  
      <Choice>
       <ChoiceOption>   
        <Tell> <action> <actionName>A</actionName> </action> </Tell>  
           <OptionAction>   
             <Choice>
              <ChoiceOption>   
                 <Tell> <action> <actionName>C</actionName> </action> </Tell>  
                 <OptionAction> 
	           <Sequence> 
	             <Tell> <action> <actionName>E</actionName> </action> 
	             <Tell> <action> <actionName>F</actionName> </action> 
	           </Sequence> 
                 </OptionAction> 
	      </ChoiceOption>   
	      <ChoiceOption>
	        <Tell> <action> <actionName>D</actionName> </action> </Tell> 
	        <OptionAction>
	          <Compose>
		   <Tell> <action> <actionName>G</actionName> </action> </Tell>
		   <Tell> <action> <actionName>H</actionName> </action> </Tell>
	          </Compose> 
	        </OptionAction>
	      </ChoiceOption>
            </Choice>
          </OptionAction>
  	<ChoiceOption>
	  <Tell> <action> <actionName>B</actionName> </action> </Tell> 
	  <OptionAction>
	      <Sequence>
		<Tell> <action> <actionName>I</actionName> </action> </Tell>
		<Tell> <action> <actionName>J</actionName> </action> </Tell>
	      </Sequence> 
	   </OptionAction>
	</ChoiceOption>
	<ChoiceOption>
	  <Tell> <action> <actionName>K</actionName> </action> </Tell> 
	  <OptionAction>
	      <Compose>
		<Tell> <action> <actionName>L</actionName> </action> </Tell>
		<Tell> <action> <actionName>M</actionName> </action> </Tell>
	      </Compose> 
	   </OptionAction>
	</ChoiceOption>
      </Choice>
        <Tell> <action> <actionName>N</actionName> </action> </Tell>  
    </Compose> 
 

The independent experience paths are :

  • A->C->E->F
  • A->D->G
  • A->D->H
  • B->I->J
  • K->M
  • K->L
  • N


Sequence of complex choice, compose, sequence combination.

The whole choice is in sequence with two sig.

   <Sequence>
   <Tell> <action> <actionName>S</actionName> </action> </Tell>
    <Compose>
     <Tell> <action> <actionName>Q</actionName> </action> </Tell>
	  <Sequence>
            <Tell> <action> <actionName>O</actionName> </action> </Tell>
            <Choice> 
              <ChoiceOption>
                <Tell> <action> <actionName>A</actionName> </action> </Tell>  
               <OptionAction> 
	          <Choice> 
                   <ChoiceOption>
	            <Tell> <action> <actionName>C</actionName> </action>   
                      <OptionAction> 
			<Compose>
			  <Tell> <action> <actionName>E</actionName> </action> 
			  <Tell> <action> <actionName>F</actionName> </action> 
			</Compose>
		       </OptionAction> 
	            </ChoiceOption>
                    <ChoiceOption>
	              <Tell> <action> <actionName>D</actionName> </action>   
                        <OptionAction> 
		           <Sequence>
			    <Tell> <action> <actionName>G</actionName> </action>
			    <Tell> <action> <actionName>H</actionName> </action> 
			   </Sequence>
		         </OptionAction> 
		    </ChoiceOption> 
	           </Choice> 
                  </OptionAction> 
	   </ChoiceOption>
           <ChoiceOption>
             <Tell> <action> <actionName>B</actionName> </action> </Tell>  
              <OptionAction> 
	             <Compose> 
	                <Tell> <action> <actionName>I</actionName> </action> 
	                <Tell> <action> <actionName>J</actionName> </action> 
	             </Compose> 
               </OptionAction> 
	   </ChoiceOption>
           <ChoiceOption>
             <Tell> <action> <actionName>K</actionName> </action> </Tell>  
              <OptionAction> 
	             <Sequence> 
	                <Tell> <action> <actionName>L</actionName> </action> 
	                <Tell> <action> <actionName>M</actionName> </action> 
	             </Sequence> 
               </OptionAction> 
		   </ChoiceOption>
           <ChoiceOption>
             <Tell> <action> <actionName>N</actionName> </action> </Tell>  
              <OptionAction>  
               </OptionAction> 
	    </ChoiceOption>
          </Choice>
        <Tell> <action> <actionName>P</actionName> </action> </Tell>
      </Sequence>
     <Tell> <action> <actionName>R</actionName> </action> </Tell>
    </Compose>
   <Tell> <action> <actionName>T</actionName> </action> </Tell>
  </Sequence> 
 

The independent experience paths are :

  • S->R->T
  • S->Q->T
  • S->O->A->C->E->P->T
  • S->O->A->C->F->P->T
  • S->O->A->D->G->H->P->T
  • S->O->B->I->P->T
  • S->O->B->J->P->T
  • S->O->K->L->M->P->T
  • S->O->N->P->T


Agent with two signals in parallel.

Spawing of a new autonomous agent

An agent creates a new node in the hyperspace. The new agent spawned by the original agent has not reference to the agent created. The only way it can share is by passing a channel thru the entry parameters so there is channel which is created thru which the spawned agent can communicate.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentName>CreateInvoiceProcessAgent</AgentName>
	<ProcessName>Invoice</ProcessName>
	<AvatarName>InvoiceNumber</AvatarName> 
          <Compose>
		<Tell> <action> <actionName>InvoiceInformation</actionName> </action>  </Tell>
		<Tell> <action> <actionName>ChInvoiceInformation</actionName> </action></Tell>
          </Compose>
     </Agent>
 

The above defines the agent. This agent CreateInvoiceProcessAgent is the name of the agent. The agent is known as the agent type Invoice and will assume the name that is present inInvoiceNumber

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentCommand> <AgentName>CreateInvoiceProcessAgent</AgentName> 
          <Tell> <action> <actionName>InititateInvoice</actionName> </action>  </Tell>
        </AgentCommand> 
     </Agent>
 

The agent . This agent CreateInvoiceProcessAgent is the name of the agent. The above agent script, spawns a new agent in the hyperspace with the namespace i.e Invoice identified as InvoiceNumber.


Agent with two signals in sequence.

Spawing of a new autonomous agent

An agent creates a new node in the hyperspace. The new agent spawned by the original agent has not reference to the agent created. The only way it can share is by passing a channel thru the entry parameters so there is channel which is created thru which the spawned agent can communicate. In this case, the spawned agent has two signals. The second signal will appear after the first signal is interacted with.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentName>CreateInvoiceProcessAgent</AgentName>
	<ProcessName>Invoice</ProcessName>
	<AvatarName>InvoiceNumber</AvatarName> 
          <Sequence>
		<Tell> <action> <actionName>InvoiceInformation</actionName> </action>  </Tell>
		<Tell> <action> <actionName>ChInvoiceInformation</actionName> </action></Tell>
          </Sequence>
     </Agent>
 

The above defines the agent. This agent CreateInvoiceProcessAgent is the name of the agent. The agent is known as the agent type Invoice and will assume the name that is present inInvoiceNumber The two signals InvoiceInformation and ChInvoiceInformation will present itself in sequence

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentCommand> <AgentName>CreateInvoiceProcessAgent</AgentName> 
          <Tell> <action> <actionName>InititateInvoice</actionName> </action>  </Tell>
        </AgentCommand> 
     </Agent>
 

The agent . This agent CreateInvoiceProcessAgent is the name of the agent. The above agent script, spawns a new agent in the hyperspace with the namespace i.e Invoice identified as InvoiceNumber.


Agent with a single choice.

An agent creates a new node in the hyperspace. The new agent spawned by the original agent has not reference to the agent created. The only way it can share is by passing a channel thru the entry parameters so there is channel which is created thru which the spawned agent can communicate. In this case, the spawned agent consists of signal operators which is couched in a configuration operator choice.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentName>AgentC</AgentName>
	<ProcessName>Agentoftypec</ProcessName>
	<AvatarName>InvoiceNumber</AvatarName> 
          <Choice>  
             <ChoiceOption>
	        <Tell> <action> <actionName>C1</actionName> </action>   
                   <OptionAction> 
		       <Compose>
			  <Tell> <action> <actionName>C11</actionName> </action> 
			  <Tell> <action> <actionName>C12</actionName> </action> 
		       </Compose>
		   </OptionAction> 
	     </ChoiceOption>
             <ChoiceOption>
	        <Tell> <action> <actionName>C2</actionName> </action>   
                   <OptionAction> 
		       <Sequence>
			 <Tell> <action> <actionName>C21</actionName> </action>
			 <Tell> <action> <actionName>C22</actionName> </action> 
		       </Sequence>
		    </OptionAction> 
	      </ChoiceOption>  
           </Choice> 
     </Agent>
 

The above defines the agent. This agent AgentC is the name of the agent. The agent is known as the agent type Agentoftypec and will be known to the outside world with the name InvoiceNumber. This agent first activates the choice, which presents a choice C1 or C2 to the observer to make a decision. On pressing C1, it raises two tell signals C11 and C12

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentCommand> <AgentName>AgentC</AgentName> 
          <Tell> <action> <actionName>InititateCAgent</actionName> </action>  </Tell>
        </AgentCommand> 
     </Agent>
 

The agent . This agent AgentC is the name of the agent. The above agent script, spawns a new agent in the hyperspace with the namespace i.e Agentoftypec identified as InvoiceNumber.


Agent with a Replicate.

Spawing of a new autonomous agent

An agent creates a new node in the hyperspace. The new agent spawned by the original agent has not reference to the agent created. The only way it can share is by passing a channel thru the entry parameters so there is channel which is created thru which the spawned agent can communicate. In this case, the spawned agent consists of signal operators which is couched in a configuration operator Replicate. Replicate operator gives separate state and behavior that is contained in the replicate. So for example if there are two replicate instances in an agent, then each replicate instance can have separate state variable and also separate behavior of future signals.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentName>AgentD</AgentName>
	<ProcessName>ReplicateExample</ProcessName>
	<AvatarName>InvoiceNumber</AvatarName> 
          <Replicate>  
             <Compose>
	       <Tell> <action> <actionName>D1</actionName> </action> 
	       <Tell> <action> <actionName>D2</actionName> </action> 
	       <Tell> <action> <actionName>D3</actionName> </action> 
             </Compose> 
           </Replicate> 
     </Agent>
 

The above defines the agent. This agent AgentC is the name of the agent. The agent is known as the agent type ReplicateExample and will be known to the outside world with the name by the contents of InvoiceNumber. This agent first activates a Replicate with three signal operators D1, D2, D3 in parallel. These action names are given for illustration, in reality this will be replaced with semantics of the business that is being modelled.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 	
	<AgentCommand> <AgentName>AgentD</AgentName> 
          <Tell> <action> <actionName>InititateDAgent</actionName> </action>  </Tell>
        </AgentCommand> 
     </Agent>
 

This agent AgentD is the name of the agent. The above agent script, spawns a new agent in the hyperspace with the namespace i.e ReplicateExample identified as InvoiceNumber.


Agents command with and without a spawning a hyperspace node.

Spawing of a new autonomous agent

Agent command is used to create reusable code. Activating the agent repeats the experience over and over again. Using Agent command a new hyperspace node can be spawned or it can belong to the same node. The presence of the process name tag in the agent definition defines whether it will spawn a new hyperspace node or not. This section gives in detail how this is accomplished.

This complex node creation and reusability of agent is illustrated with the example below. The different agents that are used in this example are AgentA, AgentB, AgentC, AgentD, and AgentE. AgentA, AgentB, AgentC, AgentD will behave as a resuable component in the same hyperpspace node. But AgentE, due to the presence of the tag ProcessName creates a separate node in the connection machine hyperspace. The actions C1, C2, A1, A2, etc are selected for ease of showing the concept. But in real implementations, this will reflect the domain.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 
	<AgentName>AgentA</AgentName>	
           <Compose>
	       <Tell> <action> <actionName>A1</actionName> </action> 
	       <Tell> <action> <actionName>A2</actionName> </action>  
           </Compose> 
     </Agent>
 

This agent AgentA is the name of the agent. The above agent script, it raises two signals A1 and A2 in parallel. Since there is no processname it belongs in the same agent in which it is activated.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 
	<AgentName>AgentB</AgentName>	
           <Sequence>
	       <Tell> <action> <actionName>B1</actionName> </action> 
	       <Tell> <action> <actionName>B2</actionName> </action>  
           </Sequence> 
     </Agent>
 

This agent AgentB is the name of the agent. The above agent script, it raises two signals B1 and B2 in Sequence. Since there is no processname it belongs in the same agent in which it is activated.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 
	<AgentName>AgentC</AgentName>	
           <Choice>
             <ChoiceOption>
	        <Tell> <action> <actionName>C1</actionName> </action>   
                   <OptionAction> 
		       <Compose>
			  <Tell> <action> <actionName>C11</actionName> </action> 
			  <Tell> <action> <actionName>C12</actionName> </action> 
		       </Compose>
		   </OptionAction> 
	     </ChoiceOption>
             <ChoiceOption>
	        <Tell> <action> <actionName>C2</actionName> </action>   
                   <OptionAction> 
		       <Sequence>
			  <Tell> <action> <actionName>C21</actionName> </action> 
			  <Tell> <action> <actionName>C22</actionName> </action> 
		       </Sequence>
		   </OptionAction> 
	     </ChoiceOption>
            </Choice> 
     </Agent>
 

This agent AgentC is the name of the agent. The above agent script, raises two signals C1 and C2. This is in choice so only one can be interacted with. On interaction of C1 it raises C11 and C12. Since there is no processname tag it belongs in the same agent in which it is activated.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 
	<AgentName>AgentD</AgentName>	
           <Replicate>  
	       <Compose>
		  <Tell> <action> <actionName>D1</actionName> </action> 
		  <Tell> <action> <actionName>D2</actionName> </action> 
		</Compose>
            </Replicate> 
     </Agent>
 

This agent AgentD is the name of the agent. The above agent script, it raises two signals D1 and D2. Since it is in a Replicate tag, the state and the actions are local to that instance. If this agent, i.e AgentD is part of a bigger node then the action D1 and D2 will have private state. This is because of the replicate structure. The actions D1 and D2 will have its own private storage. This storage can only be accessed by binding to the actions D1 and D2. This is in choice so only one can be interacted with. On interaction of C1 it raises C11 and C12. Since there is no processname tag it belongs in the same agent in which it is activated.

Configuration of new spawned AgentE

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent> 
	<AgentName>AgentE</AgentName> 
	<ProcessName>ComplexAgentExample</ProcessName>
	<AvatarName>InvoiceNumber</AvatarName>
         <Compose>	 
	   <AgentCommand> <AgentName>AgentA</AgentName> 
             <Ask> <action> <actionName>A</actionName> </action>  </Ask>
           </AgentCommand> 
	   <AgentCommand> <AgentName>AgentB</AgentName> 
             <Ask> <action> <actionName>B</actionName> </action>  </Ask>
           </AgentCommand> 
	   <AgentCommand> <AgentName>AgentC</AgentName> 
             <Ask> <action> <actionName>C</actionName> </action>  </Ask>
           </AgentCommand>  
	   <AgentCommand> <AgentName>AgentD</AgentName> 
             <Ask> <action> <actionName>D</actionName> </action>  </Ask>
           </AgentCommand> 
          <Tell> <action> <actionName>A</actionName> </action>  </Tell>
          <Tell> <action> <actionName>B</actionName> </action>  </Tell>
          <Tell> <action> <actionName>C</actionName> </action>  </Tell>
          <Tell> <action> <actionName>D</actionName> </action>  </Tell>
         </Compose>
     </Agent>
 
 

This agent AgentE is the name of the agent. The above agent script, spawns a new agent in the hyperspace with the namespace i.e ReplicateExample identified as InvoiceNumber. As part of this script, it triggers the agents AgentA, AgentB,AgentC,AgentD. These agents are triggered because of the Tell action on A,B, C,D.

    <?xml version="1.0" encoding="UTF-8"?>
     <Agent>  
	   <AgentCommand> <AgentName>AgentE</AgentName> 
             <Ask> <action> <actionName>E</actionName> </action>  </Ask>
           </AgentCommand>
         </Compose>
     </Agent>
 

This code can be incorporated anywhere. When this is initiated, it will first raise the ask signal E. On interacting with this signal, it will trigger the AgentE. AgentE having the tag ProcessName will create a new node or autonomous agent on the hyperspace. This new node will have all the signal and configurator operations in AgentE.