question

Amy avatar image
0 Likes"
Amy asked Jeanette F commented

Help with using Time by Case

I want to give different process times depending on the label of the patients.

I want to give 10 seconds if they are on a wheelchair, 20 seconds if they are on a bed, like this, But in Time by Case, it seems like I can only classify it as an int.

Is there a way I can classify as "wheelchair" and "bed"?

3_adding_transfer_time.fsm1711268937571.png

FlexSim 24.0.0
time by case
· 5
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 ·
@Amy when ever you choose a special transport, you could set a label to an according value. This makes it easier to evaluate a transport class later.
0 Likes 0 ·
Amy avatar image Amy commented ·
Hello @Joerg Vogel, I'm not sure what you mean by "set a label to an according value".

transport is a label and I wanted to use the label value as each case.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Amy commented ·

@Amy, I wasn’t precise. I mean a number instead of a string.

0 Likes 0 ·
Amy avatar image Amy commented ·

@Joerg Vogel Thank you! I understand that in "process," you can set a time by using int value for lable.

Can we specify how long it takes for "transport patient" or "escort patient" by adding a distribution? or is it only possible based on the walking speed of the nurse?

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Amy , was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Amy commented

I don't see the issue:

1711374299833.png

and your case logic seems to work fine (checked in debugger).

You could also/instead try changing the speed property of one of the travellers before issuing the escort activity and see if that has the desired effect (since the speeds are synchronised during that subflow).


1711374299833.png (23.4 KiB)
· 5
5 |100000

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

Amy avatar image Amy commented ·

@Jason Lightfoot, thank you for your answer.

I'm little confuse. You are saying that it's ok to use string values("wheelchair" "bed") in the case? Then, what does Enter case value (must be an int) mean?

screenshot-2024-03-26-at-102408-am.png

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Amy commented ·

In the past the underlying code for that option used a switch statement which did require integer values:

int case_val = token.labelName;
switch (case_val)
    case 5: return 65; 
    default: return 1;
}

but this has been replaced by a series of if statements that test the variant value:

Variant value = token.labelName;
if (value == 5) {   // could also be "bed"
     return 65;
}

return 1;

The tooltip message looks like it just hasn't been updated. I'll send a note to the dev team for it to be changed.

1 Like 1 ·
Amy avatar image Amy Jason Lightfoot ♦♦ commented ·

@Jason Lightfoot , I', using FlexSim 21.2.4 version, and I getting these errors.

1711478015495.png


The code is from the Transport Person. I'm not sure why it's giving me the error.

Object current = param(1); 
Object patient = current;
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);
Variant travelers = param(4);
Variant staff = param(5);
Variant transport = param(6);/***popup:ValuesByCase:config=ProcessFlowObject:valuestr=Object*/
/***tag:desc*//**Object By Case*/
int case_val = /** \nCase Function: *//***tag:ValueFunc*//**/patient.end_dept_id/**/;

treenode Object = 0;
/** \nCases:\n*/

switch (case_val) {
/***tagex:data*/
case /**\nCase: *//**/0/**/: return /** Object: *//**/Group("10f_A_Beds")[duniform(1, Group("10f_A_Beds").length, getstream(activity))]/**/;
case /**\nCase: *//**/1/**/: return /** Object: *//**/Group("10f_B_Beds")[duniform(1, Group("10f_B_Beds").length, getstream(activity))]/**/;
case /**\nCase: *//**/2/**/: return /** Object: *//**/Group("11f_A_ExamTables")[duniform(1, Group("11f_A_ExamTables").length, getstream(activity))]/**/;
case /**\nCase: *//**/3/**/: return /** Object: *//**/Group("11f_B_Beds")[duniform(1, Group("11f_B_Beds").length, getstream(activity))]/**/;
case /**\nCase: *//**/4/**/: return /** Object: *//**/Group("12f_A_Beds")[duniform(1, Group("12f_A_Beds").length, getstream(activity))]/**/;

default: /**\nDefault:*//***tag:default*//**/Group("b2f_D_Chairs")[duniform(1, Group("b2f_D_Chairs").length, getstream(activity))]/**/;break;
}

return Object;

/** \nNote: Case values must be positive integers.*/


0 Likes 0 ·
1711478015495.png (34.4 KiB)
Show more comments