question

Louwrens Cronje avatar image
1 Like"
Louwrens Cronje asked tannerp commented

Varying transporter capacity

We are having trouble with a concept within the model logic. We need a transporter to have a capacity that is determined by the item type that the transporter moves.

For example: A forklift must have a capacity of 1 if it is transporting item type 1. The same forklift must have a capacity of 40 if it is moving item type 2 (which has been batched on a queue).

Is there a way to do this without specifically making use of a combiner and a separator as this occurs often in the model?

FlexSim 16.0.1
transporteritemtypecapacity
· 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.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Here I answered a similar question using Process Flow to control the transporter and, as part of the model, it carries different amounts of each itemtype.

0 Likes 0 ·
Jeff Nordgren avatar image
1 Like"
Jeff Nordgren answered tannerp commented

Without the model to look at it is hard to give any specifics. Because the best way would depend on how the model functions. So this answer is going to be a general answer that may or may not point you in the right direction.

If the transporter is connected to the queue that is batching the 40 items, then in the OnEndCollecting trigger of the queue, I would set the transporter's maximum capacity using:

setvarnum(transporter,"maxcontent",40);

But I don't have a clue where you would set it back to 1 for type 1s because you didn't give any details where that happens. But you would need to do the same thing in a place that makes sense in your model.

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

Abubacker S avatar image Abubacker S commented ·

How to write the same code for a FlowTruck Tank maxcontent?

0 Likes 0 ·
tannerp avatar image tannerp Abubacker S commented ·

Hi @Abubacker S,

This is an old thread, so your comment will probably not be seen by many users. In the Answers Best Practices, it mentions that it's usually best to post a new question with a link to this question so others know what you're referring to. I'd recommend that you post a new question referencing this thread for the fastest answer. Thanks!

0 Likes 0 ·
David Besson avatar image
1 Like"
David Besson answered

You could modify the "OnLoad" trigger of the transporter:

if(content(current) == 1){ 
	int MaxContent = -1;
	switch(getitemtype(item)){
		case 1:{ 
			MaxContent = 1;
			break; 
		}
		case 2:{
			MaxContent = 40;
			break;
		}
		default:{
			debug;
			break;
		}
	}
	setvarnum(current, "maxcontent", MaxContent);
}
5 |100000

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