# Lock

An action will always be activated in every cycle if operable and not locked. The lock command can be used to prevent an action from occurring for a fixed number of cycles after the activation cycle. This can be useful for building patch cut or single tree selection harvest prescriptions where you may want to avoid harvest re-entry for a fixed number of simulation cycles. For example, if multiple entries (multiple CUT statements) are scheduled within an action (e.g., two pass shelterwood), the LOCK statement will prevent the action from being reactivated after it completes for a fixed number of cycles.

The LOCK argument states the number of cycles to lock the action for. If you are using 5 years per cycle, then ‘LOCK 5’ will cause the action to be locked for at least 25 years. With or without the LOCK statement, an action will be considered locked while the action is occurring (until the action cut/amend schedule has been completed).

Actual # of simulation cycles locked immediately following action activation equals the greater of:

· LOCK cycles

· Duration of action (determined by last cycle of scheduled CUT and AMEND events in action definition)

See lock statement use for selection method harvest in Retention examples.

## Lock other actions

Multiple actions can occur in the same cycle if operable and not locked. The LOCK statement can be used to ‘lock’ out other actions from occurring until the scheduled action is unlocked. Actions are always scheduled in OSM in the order that they are defined. If you want to LOCK out the 2nd action when the 1st action is locked, then state the 2nd action name following the LOCK cycle argument in the 1st action.

The example below demonstrates how to prevent the first and second action from occurring at the same time. Without these locks, if the stand has gross merchantable volume (GMV) >= 125 m3/ha at the beginning of the simulation, then both actions will be activated in cycle 0. The order of actions defined determines the order they will occur. With locks enforced on the 2nd from the 1st, only the first action will be activated and both the first and second will be locked from occurring again for five cycles. When GMV exceeds 100 m3/ha in future cycles, the 2nd action may be scheduled before the 1st.

ACTIONS

def FirstAction

OPERABLE.GMV >= 125

LOCK 5 SecondAction

def SecondAction

OPERABLE.GMV >= 100

LOCK 5 FirstAction

## Alternative approaches

The operable statement is often sufficient to constrain when or under what conditions the action should occur. If the prescription has a fixed sequence of cuts where number and timing of entries (cycle numbers) are known, use of multiple cut statements within the action definition may be preferable over using multiple actions and the LOCK commands. A good example of a multiple fixed-entry prescription is a shelterwood. Where timing of subsequent re-entries depends on stand conditions and time from previous entry, using the LOCK statement may be the best approach (e.g., selection method harvest).