A phase is not tied to a specific EM nor is an EM tied to a specific phase.
When a phase runs it must search for an EM that implements the phase and meets the other specified settings.
How is an EM found to service a phase?
- EM must be in the phase unit.
- EM must implement the phase.
Following are not required if only 1 EM is found that implements the phase in the unit.
- NO-EM must contain the phase unit’s vessel as a source or destination (assuming EM has sources/destinations).
Vessel is specified
- EM must list the vessel as a source or destination if source/destination vessels are listed.
Linked Unit(s) specified
- EM must list a vessel from the linked unit(s) if source/destination vessels are listed and it must be opposite the phase unit.
- EM must list the material in one of its source/destination vessels if the EM lists them and if they are configured as a single material unit.
Vessel and Material specified
- Vessel must be present with the specified material if the vessel is configured as a single material and if the EM lists its sources/destinations.
If more than 1 EM is found then the EM matching the following will be selected:
- Matches more specifically from above list (i.e. an EM that doesn’t list vessels vs an EM that lists vessels matching the specified vessel)
- Higher Vessel Priority
- Loop through and make a list of all Unit EMs that implement the phase.
- If list count <= 1 then skip to validation (95% will fall into this category)
- Remove EMs that don’t contain the vessel if specified
- Remove EMs that don’t contain the material if specified
- Remove EMs that don’t contain the material in the specific vessel if specified
- Remove EMs that don’t contain the linked unit(s)
- Score each EM for how many test is passes specifically (track max score)
- Eliminate all with a lesser score than the max
Eliminate all invalid EMs unless it is the last 1 then set failure.
- If vessel is specified then the EM must contain the vessel if the EM lists its vessels.
- If material is specified then an EM vessel must contain that material, or be empty, if the EM lists its vessels and the vessel is configured as a single material.
- If vessel and material are both specified then the vessel must contain the material if it is configured for a single material or must be empty.
- Skip if only 1 EM is in the list.
- Remove any un-available unless all are unavailable.
- Select item with highest priority or 1st in list if all the same priority.
EM Selection Criteria
NOTE: An EM only needs to satisfy the first criteria if it is the only EM that implements the phase.
The EM must be a member of the phase unit
The EM must implement the phase.
If only 1 EM is found then nothing else matters.
Is this a good test or should it line up with all specifications?
An EM source or destination vessel must be in the phase unit.
The vessel may be an EM source or destination.
The vessel must be one of the EM source or destination vessels unless the vessels are not specified by the EM.
Should the source/destination be specified or assumed?
Must find the opposite source/destination as part of the linked unit(s) from the phase unit.
An EM source or destination vessel must contain this material if the vessel is configured as a single material. If Vessel is specified then that specific vessel must contain this material if it is configured as a single material.
Material may be specified at Class, Type or Instance level. The lowest level will be used.
If an EM is found with none of its vessels (or specific vessel) matching the specified material then the phase will fail, assuming the vessels are all configured to be a single material and source and destination vessels are defined.
If multiple EMs are found then the link vessel with the highest priority is chosen; assuming no vessel is specified.
- Phase – EM must implement the phase
- Phase Unit – EM must have a source or destination vessel in the unit running the phase
- Link Unit(2) – EM may have the opposite vessel from the phase unit in the linked unit
- Link Vessel – EM must contain the linked vessel as a source or destination EM (it may be in the same unit as the phase)
- Material Class – EM must have a vessel with this class (the specific linked vessel must have this material)
- Material Type – same
- Material ID – same
If material is specified then either the source or destination must have the material, have no material, or be a mix of materials.
If material and vessel is specified then that vessel must have the material, have no material or be a mix of materials.
Add a vessel option that specifies if a vessel is limited to a single material at a time.