Workability

Overview and Key concepts

Workability objects are used to define datasets of workability data, and sequences of activities with certain workability limits. For example, consider a dataset consisting of weather data (wind speed and precipitation) given on an hourly basis for a duration of one year. In addition, suppose that certain actions in the model can only be performed under certain conditions, for example when the wind speed is below 3 m/s for at least 4 hours. The Workability object allows you to enter both the dataset and this condition, and to query the object using the user command GetEarliestStartForSequence to find out what the first available time is at which the action could take place.

The Data Tab

The Data tab allows you to enter the source dataset for the workability object, that you will later query to check the first available start time for a given process.

Interpolation

This option indicates how data values will be calculated for model times that do not exactly correspond to a row in the table, based on the given data.

  • No interpolation (steps)
    At all times from the time in one row (inclusive) until the time in the next row (exclusive) the parameter will be assumed to have the value in that row.
  • Linear interpolation
    The workability parameter will increase or decrease linearly between two consecutive rows.
  • Harmonic interpolation
    The workability parameter will be interpolated by fitting a cosine function through two consecutive table rows.
Graphically, the difference between the interpolation options is shown below, assuming you have entered a data row at time 0 and a data row at time 10, with wind speed values of 3 m/s and 5 m/s respectively.

Offset

Can be used shift the whole Data table by a certain amount. For example, if the first entry in the table has time 0 and the times in the table increase by 60 with every time step, you can skip the first 60 rows of the table by setting the offset to 3600. This will consider the row with time 3600 to correspond to model time 0 for this run, the row with time value 3660 to model time 60, etc. This option is useful if you have multiple years of data in the table, and you wish to set up your model (for example using the Experimenter) such that different scenarios or replications use different years from the dataset.

Rows / Columns / Table

These fields allow you to quickly change the size of the table, so that you can copy/paste in your dataset.

Please note that the table only allows for numeric data to be entered. When pasting many rows (say, more than 10,000), the paste action may take up to a few minutes to complete.

The Sequences Tab

The Sequences tab allows you to enter the workability sequences that you want to execute against the dataset.

The GetEarliestStartForSequence command will allow you to query the earliest start time of a given sequence.

Sequences consist of activities, that need to be executed in orders. Some activities may have alternatives, for example: either a moderate wind speed and moderate wave height, or a higher wind speed but lower wave height.

To add a sequence, click the Add button at the top of the tab. This will add a new sequence at the bottom of the window.

Name

All sequences have a name, which must follow the FlexSim conventions for naming objects. When you use the GetEarliestStartForSequence command to find out when a sequence can start based on the current workability conditions, you can pass in either the sequence number (starting at 1 for the first sequence in the window, 2 for the second sequence, etc.), or you can use this name.

Activities table

Sequences consist of activities. A sequence can only be executed, when all its activities can be executed without interruptions. Each activity has a duration, in model time units, in the first column. The following columns correspond to the columns of the table on the Data tab. They specify a maximum value - an activity will be able to be executed when the current value for the workability parameter is less than or equal to the maximum specified in the Activities table of the Sequence. If you do not want to consider a parameter in the evaluation of the activity, you can right-click the field and select the "Set as unconstraining" option. This will change the field to "N/A". The right click menu also contains options to Add another activity or Remove an activity from the table.

You can add alternative activities using the Add Alternative button. Alternative activities are added below a main activities and specify an alternative set of parameters that will make the activity feasible. The following example shows a sequence with two activities that need to be completed in sequence. The first activity, Installation, can be completed either when the wave height is below 2.5 and the wind speed below 3; or when the wave height is below 1.25 but with a larger margin for the wind speed. Any combination of these is allowed: for example if 8 hours satisfy the first condition and the next 4 hours have a higher wind speed but satisfy the second condition, the activity can take place. After this period of 12 hours, there should be a four-hour period with a wave height below 3 and any wind speed.

Re-order grip

If you want to use the sequence index to specify a sequence in the GetEarliestStartForSequence command, you can use the "grips" (the gray dots at the left hand side of the sequence) to drag the sequence up or down. Release the mouse button and press Apply to effectuate the new order.

The GetEarliestStartForSequence command

Contrary to, for example, the level triggered event, which automatically fires an event whenever a specified trigger level is reached, the workability object is intended to be queried manually to check whether a given sequence can be executed and - if not - when the earliest start date is.

In order to find the earliest possible start for a given sequence, you use the GetEarliestStartForSequence command. It takes the following parameters:

Type Name Description
treenode/string workabilityObject The workability object, either specified by name of a workability object in the Toolbox, or by a direct reference to the object in the model tree.
int/string sequence The sequence, either by index (starting at 1) or by name as specified in the Workability Sequences page.
double offset An optional offset to add to the current time to check the earliest start time. Omit or pass 0 to get the earliest start time after the current time.

The workability object can be specified by name as it appears in the Toolbox, or by a direct reference. The sequence can be specified by name or by index (starting at 1).

If the workability could not be determined, the function returns -1.

Examples

Suppose there is a workability object called "Port workability" in the Toolbox with a single sequence called "Manoevring and Mooring". All of the following function calls will determine the model time after the current time at which this sequence can first be executed, according to the parameters of the sequence and the data set.

double firstStartTime =
  // Explicitly by name
  GetEarliestStartForSequence( "Port workability",
    "Manoevring and Mooring" );

  // By sequence index
  GetEarliestStartForSequence( "Port workability", 1 );

  // By explicit reference to the workability object
  Object workability = model.find( "/Tools/GlobalNodes/" +
	"FloWorks/Workability/Port workability" );
  GetEarliestStartForSequence( workability, 1 );

  double delay = firstStartTime - time();
  return delay;

Suppose that the port sailin process also takes four hours, and you want to make sure that you are able to perform the Manoevring and Mooring sequence immediately when it has completed.

In that case, you pass the four hour delay into the GetEarliestStartForSequence to get the earliest start time of the sequence which is at least four hours from now:

double firstStartTimeAfterSailin =
  // Explicitly by name
  GetEarliestStartForSequence( "Port workability",
    "Manoevring and Mooring",
	hours(4) );

  double sailinDelay = firstStartTimeAfterSailin
	- (time() + hours(4));
  return maxof(sailinDelay, 0);