question

Fang J avatar image
0 Likes"
Fang J asked Fang J commented

What's the meaning of musthavespace?

Sorry, my English is not very good, I hope you can understand what I want to express . When I was learning storage knowledge, I encountered a problem which is where the blue line is drawn. What's the meaning of mustHaveSpace,and what happends if I deleted "int mustHaveSpace=1;".

1.png


FlexSim 21.2.0
musthavespace
1.png (39.6 KiB)
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 Fang J commented

This is a construct to let evaluate the method hasSpace

There is a template, where you can say that a slot must have space or not. The method checking this is hasSpace. If you combine this method logically with a variable called here “mustHaveSpace” by an AND operator, both arguments must be true to evaluate the method hasSpace successfully.

The variable mustHaveSpace can be 0 to be logically false or greater than 0 like 1, 2, or 437 to be evaluated as logically true.

It is a workaround to insert a method like hasSpace in conditions by an action similar to a radio button or a check mark.

· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

“What happens”: if you delete this line, you destroy the template structure for the template icon to edit the function in the template editor.

if you erase int mustHaveSpace = 1, then the condition of the if-statement contains an undeclared variable and throws an error.
if you erase the variable mustHaveSpace from the code, then the filter always checks if the slot has space for the dimensions of the involved item.

0 Likes 0 ·
Fang J avatar image Fang J commented ·

your explanation is very detailed,which is really helpfor to me.

0 Likes 0 ·