Main Content

Selection Server - Select Specific Entities from Server

Description

This example shows how you can use the MATLAB Discrete Event System block to write a custom N-Server from which specific entities can be selected using a key lookup. Passengers enter from the IN port of the block and are stored in the block until a message arrives at the KEY port carrying a lookup key. Upon receiving this message, the system schedules an "Iterate" event during which it can visit every entity stored in it and output the one that matches the key.

Results

The simulation prints information about entities entering the MATLAB Discrete Event System block and selection commands.

Passenger entry: key = 2.000000
Passenger entry: key = 10.000000
Baggage entry: key = 10.000000
Passenger exit: key = 10.000000
Passenger entry: key = 4.000000
Passenger entry: key = 5.000000
Passenger entry: key = 3.000000
Baggage entry: key = 3.000000
Passenger exit: key = 3.000000
Passenger entry: key = 8.000000
Passenger entry: key = 7.000000
Passenger entry: key = 1.000000
Baggage entry: key = 8.000000
Passenger exit: key = 8.000000
Passenger entry: key = 6.000000
Passenger entry: key = 9.000000

See Also

Related Topics