Tutorial: Basic Receptors, Part I
This section will introduce you to the basics of using receptors. You will learn about some core receptors and perform some simple tasks working with a few different receptors.
Hello World Receptor
The Hello World receptor is actually simply an emitter of the log message "Hello World".
When you add this receptor to the surface, you'll notice that every two seconds a carrier (the red triangle) is created at the edge of the receptor. These are signals that are waiting for another receptor to process, but since there isn't one, they just accumulate on the emitting receptor.
Receptors can be configured to emit carriers even if there is no receptor currently available to process the carrier.
Enabling and Disabling Receptors
Double-clicking on a receptor will toggle whether or not it is enabled or disabled. A disabled receptor appears in red. Double-click on the Hello World receptor and you will see it turn red and no further carriers will be emitted. Double-click on it again and it will turn green again, indicating that it is active.
Some receptors have dialog boxes that will appear when you double-click on the receptor. You can enable/disable these receptors using the checkbox on the configuration dialog.
Enabling / disabling receptors is a simple way of controlling computational chains.
The Logger Receptor
This receptor receive log messages, like the ones that the Hello World receptor produces, and emits log messages as fly-outs, as illustrated here by adding the Logger to the surface containing the Hello World receptor:
Now our "Hello World" logging messages have somewhere to go!
Receptors on the HOPE surface automatically show signal inter-connectivity. An emitted signal emerges from the edge of a receptor and its endpoint is the center of the consuming receptor.
Removing a Receptor From the Surface
To remove a receptor on the surface, simply drag it off of the surface. This works whether the receptor is contained in a membrane or not (more on membranes later on.)
Go ahead and remove the Logger receptor.
The Text Display Receptor
Add a Text Display receptor. This receptor has the quality that it displays the contents of a semantic "Text" type. The logger signal that the Hello World receptor generates has the following semantic hierarchy:
- Logger Message
- Text Message
When the Text Display receptor is present, any signal whose semantics contains the type "Text" will result in a new signal of just that semantic type being created. This is a general rule that applies to any signal -- if there is a receptor interested in any sub-type of that signal, then HOPE will create additional signals of that sub-type ( of course, you do have control over this behavior). This topic is discussed in much further detail in the tutorial on Semantic Data.
For now, let's look at what happens when we have the Hello World and Text Display receptors together on the surface:
Notice something interesting -- the Text Display receptor is showing the Text values ("Hello World!") but there are unprocessed carriers in orbit around the Hello World receptor -- these are the root Logger Message signals!
When we add the Logger receptor back into the system, we can see both working in unison -- even though the Hello World receptor is generating only one signal, any "interested" receptors get that signal or some semantic element of that signal:
HOPE is an emergent computational space because a HOPE system immediately integrates new semantics and processes into process chains.
As can be surmised from its name, this receptor speaks text signals using speech synthesis. As with the text display receptor, HOPE will direct and semantic type "Text" to this receptor. Replacing the Text Viewer receptor with the Text To Speech receptor, we instead have, as an example, this configuration:
In the above system, we have displayed the text display and opted to instead use speech synthesis to speak the text emitted by the Hello World receptor.
"Visualizations" (including less traditional means of rendering a signal, such as speech synthesis) provide a richer environment that the user can tailor for the kind of work that the user wants to accomplish and the manner in which the user wants to interact with the system.