question

Eduardo avatar image
0 Likes"
Eduardo asked Joerg Vogel answered

Can I reset the MTBF/up time properties when an event occurs using custom code?

I want to reset the MTBF uptime without compromising its statistical properties when an event occurs, using a line of custom code. I'll provide an example to illustrate the process, although I'll be using deterministic data for clarity. The idea is to use statistical distributions.libro1-excel-19-04-2024-9-30-35-p-m.png


FlexSim 23.2.1
customcodecustommtbf
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

You have to delay events of involved object in the event list. MTBF/MTTR tool belongs to functions which creates events when a previous event had finished. When MTTR ends automatically an event to beginn next MTTR is directly created in the event list. You have to identify involved object and delay events of it.
https://docs.flexsim.com/en/23.2/Reference/CodingInFlexSim/CommandReference/CommandGroupsIndex.html#Events

If this interferes with other timed events like process time finishing then you may have to delete events of MTBF/MTTR and invoke by execute flexscript node function an updated set of events. [hint of command name: fsnode is a phrase from very beginning of FlexSim versions. It is really old. This involves it is elemental to the FlexSim engine.]

As stated in manual event commands are for developer use only. You need to understand what events are for and how they interact with your simulation run. This involves several times watching event list and event logs.

You can prevent updating events, if you can estimate before parameters of functions are executed and change return time values.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.