Best way to assign 80+ labels based on percentages?

Best way to assign 80+ labels based on percentages?

marzanne_dda
Not applicable
1,894 Views
8 Replies
Message 1 of 9

Best way to assign 80+ labels based on percentages?

marzanne_dda
Not applicable

[ FlexSim 19.0.0 ]

I'm working on a decently complicated model and I'm quite new to FlexSim, so all recommendations will be extremely appreciated!

The most complicated part of my model, so far, has been the high volume of different labels that I would like to use. For the first half of the process that I'm modeling, the incoming items are sent to 1 of 80 different destinations. I have used historical data to determine the percent of time that an item is sent to each particular destination, which ranges from 0 to almost 8%. I tried to put all of these values in a Global Table, but I'm worried that the table is only registering three digits (0.01, for example, when the true value is 0.0058). My first concern is that I will not be able to find a method that can assign values to labels with percentages less than 1 percent.

The second concern that I have is where to assign these labels, and how exactly to go about that. I have tried to create string labels for each destination that is the 3-character code for that destination, but I haven't quite figured out where those need to be referenced yet. This first part of my model is pretty simple- one source attached to a queue that pushes to a list ("Ready Items"), and processors (represent the 80 destinations) that pull those items from that list. I would like each processor/destination to pull only the items that match the destination assigned at creation.

Thanks in advanced for any recommendations/advice!

Edited to add: How should I connect the Global Table (assuming this is the best way to do this) to the list(s) that the queue pushes to and the destinations/sources pull from?

0 Likes
Accepted solutions (1)
1,895 Views
8 Replies
Replies (8)
Message 2 of 9

jeff_nordgren
Not applicable

@Marzanne DDA,

The answer to your first question is easy. In the main menu Edit>Model Settings, you can click on the green + icon at the right side of the Decimal Precision field. That will allow you to edit the number of decimal points that you want in your model.

The second question is really tough to answer specifically without seeing your model or a sample model of the problem area. Is there anyway you could send us your model or a sample? If you don't want anyone seeing your model but FlexSim, you can create another question and mark it "Private". That way no one else will be able to see your question but FlexSim employees.

0 Likes
Message 3 of 9

marzanne_dda
Not applicable

I'm glad to hear that there's a simple answer to one of my questions!

I've attached what I've been working on-- I've been focused on only one of the areas (1HL) that will be covered by this simulation instead of all 5, but I've left the other ones in there since I'm not sure if taking the processors out will affect the Global Table I've created with the percentages. Some of the logic might be kind of a mess because I've been changing and replacing a lot of things to try and find out what works best.

Thank you for your response!

deliverymodel.fsm

0 Likes
Message 4 of 9

joshua_s
Not applicable

Some values are still showing up as 0, can you change the model settings to the decimal places to the amount you want, or are they supposed to be 0?

0 Likes
Message 5 of 9

joshua_s
Not applicable

@Marzanne

This code should work, I don't know where you are planning on putting it, but the variable "Dest" references the processor you want to send the item to.

double randomnum = uniform(0.0, 100.0)*.01;
double total = 0.0;
string Dest;
for (int i=1;i<=Table("Split_BoxPicks").numRows;i++)
{
	total+=Table("Split_BoxPicks")[1];
	if (randomnum <= total)
	{
		Dest=Table("Split_BoxPicks")[2];
		break;
	}
}
return model.find(Dest);
0 Likes
Message 6 of 9

marzanne_dda
Not applicable

There are two destinations that have values of 0, I kept them in there in Excel in order to compare this type of machinery to another one that delivers to those destinations.

0 Likes
Message 7 of 9

marzanne_dda
Not applicable

@Joshua S, I've put this code in with the Send to Port command of the queue, do you know if there's any way to tell if it's actually sending them to the correct destinations instead of randomly? I was also wondering if I needed to change the Pull From List command for each of the processors-- I've edited the input/output logic for each of the processors and attached an updated model.

Thank you so much for your help with this! After I worked through all of the FlexSim tutorials I thought I had a really good grasp on it, but it's a bit more confusing when you're working from scratch.

deliverymodel02.fsm

0 Likes
Message 8 of 9

joshua_s
Not applicable

All the processors where pulling items randomly from the List because there was no way of telling the processor which item to pull, also you put the code after the return line in the queue, so it never ran. I changed some things to your model and will show you what other changes need to happen. I added the code to a "On Creation" Trigger in your source, so it gives the item a label and assigns its destination to that label based on the code I previously provided. Then in your list I added another label field so we can query that destination.

17769-pic2.png

now you will have to go to each processor and change its pull logic to the picture below. This will tell the processor pull the item from the list if the items label"destination" matches the processors name.

17770-pic1.png

17760-deliverymodel02-3.fsm

0 Likes
Message 9 of 9

joshua_s
Not applicable
Accepted solution

Also here is a sample model with the data you provided that shows you the distribution based on percentages works. Run the model and look in the table, the last column of each row shows the actual percentage, and it will even out to the value you provided over time.

test-case.fsm

0 Likes