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 01-23-2008
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Default Multi-Processor Help

Hello,

I was wondering it it is possible to send an item to a port by case value and by percentage?
So the end result would be, the Multi-Processor would only send a certain percentage of a particular item to a port. The remaining percentage would be sent to a different port.
  #2  
Old 01-24-2008
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

Davie,

I am not sure if I understand your questions right, but there is a pick option in the Send To Port which is called By Percentage (inputs).

I would think, if you use this code modify it, it would do the job.

You could do something like that you use a switch statement depending on the item type.

Code:
int iItemType = getitemtype(item);
switch(iItemType)
{
          case 1:
          {
                      // insert whole code for percentage
                      // or use example below
                      break;
          }
          case 2:
          {
                      // insert whole code for percentage
                      // or use example below
                      break;
          }
          default:
          {
                      msg(getname(current),"Unexpected switch case!"); stop();
                      break;
          }
}
Maybe this (// insert whole code for percentage) is not the most elegant way, because parts of the code are several times in it, but you could make this code more general. I think of using e.g. a Global Table for the percentage and depending ports for every itemype and just read in the right cell.

Or depending on the number of cases you have you could also build your own logic for the different itemtypes like
return bernoulli(50,1,2);

or using instead of bernoulli() dempirical() and a Global Table for the ‘// or use example below part’ in the above example.

Okay, this is not a finished solution but hopefully gives you some hints to figure out a solution for you. If you have any problems or more questions, just feel free to ask.

Good success.
tom the (A)tom
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #3  
Old 01-27-2008
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Default

Thanks Tom,

I think that I figure out my problem by using Flow Nodes instead. Now I am pulling certain items in the Flow Node from the "Flow" tab. I've noticed that you can only pull one item at a time, so I tried using this following logic code

Specify Itemtype
Itemtype: 2||3||4||5||6||7||8||9||10

Though I do not get any error, this doesn't seem to work.
I am sure it is possible to 'pull' more than one item, I'm just not sure how to code it.
  #4  
Old 01-27-2008
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Smile

Kindly ignore the above post.
I continued playing around until I found the Range of Itemtypes

But thanks for reading, you guys are nothing but great!


Thread Thread Starter Forum Replies Last Post
Using multi-dimensional arrays with flexscript Cliff King Tips and Tricks 0 12-15-2007 11:25 AM


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.