0

I have made a big Anylogic model with fluid library, and I see that it’s work not fast. I tried to make a profiling with sampling , and it’s shows me that many time used to some com.anylogic.libraries.fluid.Tank.executeActionOf(EventTimeout)

Tank is anylogic own component and I don’t understand what event and why continuously calls: Tank.executeActionOf(EventTimeout)

I look at Anylogic online help and found that

public void executeActionOf(EventTimeout e)
Executes action of a timeout event.
Implementation in a subclass can be skipped if the action(s) are empty.
Parameters:
e - the event

But I didn’t use any events with tank and I don’t understand what action in my code causes this event to be triggered

I read Anylogic help and use google

1 Answer 1

1

Thanks for the answers. I found the reason. This event was triggered due to the fact that at a certain point in time my tank was overloaded (load = maximum) and the OnAbove() event was constantly triggered.

To your comments about the slowness of the Fluid library, yes, I confirm this, but considering that there is no other alternative for oil and gas and I have to use Anylogic fluid. In the process of using fluid library, I found a lot of tricks that can improve its performance. Here they are (maybe someone will need them). You need to understand that most of the time in this library is spent on recalculating the LP task (as I understand the LP task of maximizing the flow over the network) by the internal Solver of the apache.math library). Low performance is mainly due to the fact that the recalculation of the LP problem occurs in it after ANY change in the parameters of the fluid library components. For example, if valve was closed, and you call the open command, the LP task will be recalculated (this can be seen during profiling). These are obviously unnecessary actions, since for practice we would like to set the values of all the parameters as we need, and then solve the LP problem 1 time. But as the Anylogic support service told me, this is not possible. What have I come up with to increase productivity: 1 Redefine all Fluid Library methods so that they are triggered ONLY when the value changes. For example, on Valve, in the "Additional class code" field: public void set_closed(boolean closed) {

if (closed!=super.isClosed()) 
super.set_closed(closed); } 
public void set_openRate(double openRate) {
 if (openRate!=super.openRate) 
super.set_openRate(openRate); } 

After such a redefinition, the LP will be recalculated only when the value changes. If Valve is closed and you make it closed again, then the LP task will not be recalculated (since it is not necessary). 2 For FluidSplit and FluidMerge, the LP of the task is recalculated both when setting set_fraction1() and after set_fraction2(), i.e. 2 times. I understand that recalculating LP after set_fraction1() is pointless. Therefore, initially set set_fraction1(1) and use only set_fraction2() for separation. After all, if we divide the stream as a/b, then this can be done as set_fraction1(1) and set_fraction2(b/a). If you additionally set:

public void set_mode(SplitMergeMode mode) { 
if (mode!=super.mode) super.set_mode(mode); } 

then LP will no longer be recalculated for set_fraction1(1), and this is a 2-fold increase in performance

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.