ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 11-14-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default How to set the process of two itemtypes by the MultiProcessor

There are two itemtypes. And their process time are different by exponential distribution. I set "Case By Value" and the code is

----------------------------------------------------------------
treenode current = ownerobject(c);
treenode item = parnode(1)

int value = getitemtype(item)

switch(value)
{
case 1: return exponential(0,50,1);
case 2: return exponential(0,100,1);
default: return 0;
}
------------------------------------------------------------------
Do I need to add "break" to each case?
  #2  
Old 11-14-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi,

You may not need to use break, because you have return i the case statement.
But I would suggest that you use break. The reason to that it is easy to get in
to habit not use it and when you at a another time write code that requires break
there is a risk that you forget to use break and your code will not work as you
expect it to do.

I would write the switch like this:
Code:
switch(value)
{
case 1: return exponential(0,50,1); break; case 2: return exponential(0,100,1); break default: return 0;
}
Lars-Olof
  #3  
Old 11-16-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Unhappy

Thanks so much~
Attached Files
File Type: zip MM2.zip (44.7 KB, 293 views)

Last edited by Vic Li; 11-16-2008 at 05:30 AM.
  #4  
Old 11-04-2009
mohanboyapati's Avatar
mohanboyapati mohanboyapati is offline
Flexsim User
 
Join Date: Oct 2009
Posts: 13
Downloads: 3
Uploads: 0
Thanks: 7
Thanked 1 Time in 1 Post
Rep Power: 129
mohanboyapati is on a distinguished road
Default different item types.

While using the case by value, is there any way that I can run item 1 for say 10 hours or 1000 parts and then switch to run item 2 for 20 hours or 2500 parts.

Thanks

Mohan
  #5  
Old 11-05-2009
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Mohan,

You could use one source and on the OnCreation trigger make a distinction. If you look at the custom code you could define newtype as:

double newtype = 1;
if( getoutput( current ) > 1000 )
{
newtype = 2;
}

This way the first 1000 will be type 1 and after that type 2 will be generated.

If you want to make a change after 10 h you could use the following if statement:

if( time() > 36000 )

Hope this will help you.

Esther
  #6  
Old 11-06-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Just one side note from me here.

If you use statements like time() > 36000 in discrete event simulation you should be aware of the fact, that if no event happens at this point in time the code will not be evaluated. If the next event e.g. happens at 37000 the condition will become true the first time at simulation time 37000.
To be save I would use a User Event at 36000 because this is an event.
In your describe task I guess everything is fine, because there will be an event when the next item gets created which will get the new type. So in this sense it does not matter if this item arrives at 36000 or 37000 because the type will be the new type.
But I thought it is good for everybody to be aware of it.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 3 Users Say Thank You to Tom David For This Useful Post:
zhang xin (11-06-2009)
  #7  
Old 07-15-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default taskexecuter deciding process times

Is there a way that the taskexecuter decide the process time on a multiprocessor. I am modeling an ED on standard flexsim and I want to show a junior doctor and a senior doctor. Multiprocessor acts as a BED on which various processes related to treatment can be modeled. Out of these their is a process that a doctor has to perform. Now I want to model that if a junior doc comes he takes more time doing so than senior doc. The Bed can get either of these randomly or on basis of availability.. Any suggestions ?
  #8  
Old 07-16-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

first we should know, are the doctors flowitems ot taskexekuters?
If doctors are flowitems, then you can use cases by value in the process time.
if you use taskexecuters as doctors then it is not easy anymore. The multiprocessor has to know which doctor is arriving. Therefore you write your own utilize tasksequence to call a taskexecuter to the multiprocessor. To get the tasktypes of such tasksequence execute the command profiletasksequence(..) on a taskexecuter when he is in support process on a processor.
Write your own tasksequence in the pick operator code field. That tasquence should contain quite at the begining a sendmessage task with the parameter involved1 as reference to the processor (current) and involved2 as NULL.
Now on message the multiprocessor receives with the command msgsendingobject the information which taskexecuter arrives and change a label of the experience of the doctor.
But there is a small but. The first processtime is for the mutltiprocessor the same time for the two doctor types. Maybe you choose this time very small.

Jörg
  #9  
Old 07-17-2015
Rahel Carolina
Guest
 
Posts: n/a
Downloads: 30
Uploads: 0
Default

Hi everyone,

I want to create two type of product in one source, so for example after 100 outputs of product 1, it will be delayed for 15 mins and source will create product 2. And after 100 outputs of product 2, it will be delayed for 15 mins then source will create product 1 again and so on.
Like it alternating two types of product in batches of 100.
Can I use switch code to for that?

double producttype = 1;
if( getoutput( current ) > 100 )
{
producttype = 2;
}
  #10  
Old 07-18-2015
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

Hello Rahel,

You choose the Arrival schedule from the source then add that delay time in the arrival time.In the schedule table you set the quantity of items and check the box Repeat schedule.This way the sequence will repeat itself until the model runtime is completed.
  #11  
Old 07-18-2015
hendry teo
Guest
 
Posts: n/a
Downloads: 41
Uploads: 0
Default Hope this simple model will help

Hi Rahel

I created user event to control the input of the queue so that it will only receive batches of products every 900 seconds (15 minutes). Hopefully this might be useful to you!

Hendry
Attached Files
File Type: fsm batches of products out after 900 secs.fsm (14.8 KB, 508 views)
  #12  
Old 07-20-2015
Rahel Carolina
Guest
 
Posts: n/a
Downloads: 30
Uploads: 0
Default

Hallo Hendry and Sagar,

Thanks for responding.
@Hendry: From the sample model that you made, the source creates 100 boxes at once and wait for 900 seconds (15 mins) to produce the other products (and so on). But what I want to create is source only creates only 1 box at once. Until it produces 100 boxes, then it will stop the output for 15 mins (break time). After that "break time", source creates the other type of product and the rules are the same.

Can you guys please help me?
Thanks.

Rahel
  #13  
Old 07-21-2015
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

Hello Rahel,

If you want to create only one item at one time then you have to use interarrival time mode.It is the time between exit of one item and arrival of next item.You want to stop the source from producing the items for a certain amount of time and again resume the production. Place a Queue before the source , send a delayed message to itself for the delay of 15 min and then in the OnMessage trigger openoutput on message.Probably you want to write multiple if/else if statement somewhere to change the itemtype for the corresponding output.
Attached Files
File Type: fsm Breaktime.fsm (14.4 KB, 453 views)

Last edited by sagar bolisetti; 07-22-2015 at 02:53 AM. Reason: attach sample model
The Following User Says Thank You to sagar bolisetti For This Useful Post:
Rahel Carolina (07-22-2015)


Thread Thread Starter Forum Replies Last Post
Picking process Simon Farsah Q&A 9 03-23-2015 06:55 AM
Can a combiner process multi items simultaneously? KelvinHo Q&A 6 11-08-2010 11:29 AM
Multiprocessor Frames Simon Riopel Q&A 3 09-09-2008 01:19 AM
Operator dependent process times Unregistered Pre-sales Questions 7 05-23-2008 03:01 PM
stopping the MultiProcessor Pablo Concha Q&A 4 10-31-2007 07:34 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.