question

HK avatar image
0 Likes"
HK asked Sam Stubbs commented

Expression for resource status

Hello,

I'd like to utilize expressions in "Conditional Object". What would be the expression for this statement: If a resource A is on duty, request resource A. otherwise request other available resources. I want to utilize expressions more in the model for more flexibility but I can't find information about expression grammars/logics in the documentation. is there something I can refer to?

Also, for the case above, I assume "conditional object" is the correct option to choose. What is "Object by case" then? what's the difference between the two?


Thank you!

FlexSim 24.1.1
object by condition
· 1
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 ·

classic: Switch by case is returning a static value upon an discrete value.

A condition is an logical expression of true and false, which evaluated values can be continuous.

0 Likes 0 ·
Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered Sam Stubbs commented

When you say resource are you speaking about the Process Flow shared asset "Resource." Or do you just mean general resources like task executers / operators.

If you're going the Process Flow route. Your situation should be handled simply as the default logic of the Resource. When you acquire a resource, it won't be available for other tokens/activiites to acquire it, until it has been released again.

If you're just meaning a general sense of task executer resources (for example operators) then you'll want to use a dispatcher. This can help you achieve the type of logic you're looking for. Send the tasks directly to dispatcher, and it will reroute it to available connected task executers. (See the Dispatcher object information in the user manual.)

Is this the kind of resource management you're looking for?

· 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.

HK avatar image HK commented ·

Thank you for your response.

I'm using HC Flexsim, and I meant resources used in the process flow. For example, I want to route patients to different places based on the available beds. If there is any available beds in an area, I want to route patients to the area (skip through some processes) and otherwise route patients to a different area. Also, I want to apply similar expressions to doctors.

In addition to these cases, I want to use the expressions more frequently within my model but I can't find examples of expressions. please help.

Thank you!

0 Likes 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ HK commented ·

If you're looking to just reroute patients to an alternate area based on if the first location group is occupied you can use the HC activity sets that have a "wait area" as a template. In the acquire resource activity, just set the max wait timer to 0, and have the On Max Timer event reroute the patient to an alternate area or flow. You can do this for locations (beds in your example) or for staff (the doctors). Basically anytime a patient is trying to acquire any resource, just use the max wait timer as a means of rerouting if that resource is currently unavailable.

waitarea.gif

0 Likes 0 ·
waitarea.gif (410.8 KiB)
Valencia avatar image
0 Likes"
Valencia answered HK commented

Hello there

You can use a conditional expression to handle the situation where you request resource A if it is on duty and request other resources if not. Here is an example of an expression if A. is On Duty This makes resource management more flexible.

You may add conditions to your model using Conditional Object. On the other hand; Object by Case describes the use of various objects according to discrete scenarios or cases.


· 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.

HK avatar image HK commented ·

The main question was: What would be the expression for this statement: If a resource A is on duty, request resource A. otherwise request other available resources?

could you help with the question? thank you!

0 Likes 0 ·
HK avatar image HK commented ·

Thank you for your response! Yes, I'd like to know the expressions I can use in a condition. could you please write the expressions?

0 Likes 0 ·