COGENT Online
CONTENTS
COGENT Help

Data/Source

Introduction

Data sources are generally used to feed fixed messages to a model at fixed stages of processing. Their usual function is to act as input devices, where they can feed a stream of input to the model. This input stream consists of a list of messages. Any Prolog term can be passed as a message, so data sources can be used to feed information of arbitrary complexity into a model. Data sources can also send multiple messages on a single cycle (including messages to different boxes). Thus, they can be used to trigger rules in a process (see below), or to add elements to a buffer.

Data sources do not have any properties associated with them. Unlike other classes of box, where properties can be used to configure behaviour for specific purposes, the general behaviour of data sources is fixed. This is because the flexibility in the specification of messages to be sent by sources has, to date, proved sufficient.

As with all COGENT objects, there is no limit to the number of data sources you can have in one model, and they will all behave as independent devices.

The Data Editor

The editor associated with data source elements allows arbitrary sets of messages to be associated with each cycle. Beneath the Add Element button is a menu of element types. This menu has options for each type of message that is valid given the arrows currently leaving the data source. If a data source has a send arrow to a buffer, then the options will allow adding, deleting and clearing of buffers. If an arrow also leads from the source to a process, then an option for sending to a process will also be included.

If you select an option from Add Element a new line of widgets will be created on the editor describing a schematic message of the appropriate form. (For example, selecting add from the buffer submenu will create a schematic add message.) The precise widgets that appear depend on the type of message, but typically include a small button at the beginning of the line (hiding a menu of operations which will apply to the whole line), an indication of the message type (e.g., add), a field to specify the message content (as a Prolog term) and a target for that message. If, given the arrows from the data source, there is only one possible target, then its name will be automatically inserted. Otherwise the target will be indicated by ??? but a menu button will allow selection between all possible targets.

Add Element may be used to add any number of elements to a data source, and the functions concealed beneath the buttons at the beginning of each line of widgets may be used to further edit (or even delete) the corresponding message.


COGENT Online
CONTENTS
COGENT Help