Cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the storage strategy of “Random” when I put parts into genericRacks(the objects is store)

Genius
Genius

Hello,everyone

I’m studying how create a model ,which put parts into store. There are 2 Racks to store parts in the model.I post the mode in the attachment,so that you can refer to it.

Firstly ,I set the storage strategy as “Random”.

Secondly, I set the values of store .Xdim and store.Ydim:X=20,Y=13.

Thirdly, the “Random” storage method is:

xPos := z_uniform(1, 1, track.XA + 1); -- Here TRAck.XA=X=20

yPos := z_uniform(1, 1, track.YA + 1) ; -- Here TRAck.YA=Y=13

one part will move to the the position whose number is (xPos,yPos) in the store. If I run the model, it means one store will contains “20*13=260 “parts, so the 2 stores will hold 520 parts.

 

Actually, when I start the model, the results are shown in the following picture:

The number of all the parts in the stores is "505 "with the blue marks,which is less than 520,that is to say ,there are vacant positions left which the parts can be moved with red marks.

 

Strage01.JPG

 

So,what should I do to resolve the problems.

Looking forward to your valuable directions!

Any help is great appreciated!

 

 

 

 

 

7 REPLIES 7

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Gears Phenom Gears Phenom
Gears Phenom

Hi MarkLee,

you have a loop that randomly chooses a storage location from (x,y) = {1,1}..{20,13} and then randomly (50:50) chooses the side (left/right) and then checks whether that position is free. After 50 randomly checked locations you receive the error message. You have 505/520=97% occupancy rate, so it is not surprising for me that your method will pick 50 occupied places in a row, even though there are free places available.

I would suggest to write all available places into a tablefile during init and then randomly choose a row from that table when you need a storage location, then delete that row and re-insert it once the position was cleared by an MU again. That way is more efficient and you can go up to 100% without increasing your max-retry-counter to 10000000. Smiley Happy
Regards,
Alex

___________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Genius
Genius

Hi,AlexD_SimPlan

 

I got what your meaning ,however,it's a little difficult for me to do it!

Could you create a samll model to show how to create the tablefile  to achieve the goal.the storage location from (x,y)={1,1}..{3,3}  is OK.

Looking forward to your further example model!

Thank you!

Highlighted

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Genius
Genius

Hi,Alex

 

According to your suggestions, I create a small model just for storing the parts into the store with "Randomly" stratety. it does't contain how to remove the parts from the store. the model is posted:when i run it .

the results are in the following pictures:

the model stops without any "warnning" after a shot time,and the parts can't move to the store  eventhough there are many empty positions left.

I don't know what happens about the model ,please help me!!

Looking forward to your directions!

 

 

 

 

 

 

 

捕获.JPG

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Gears Phenom Gears Phenom
Gears Phenom

Basically you have a table tFreePlaces and during an init-method you fill it like this (delete it during reset):

-- fill table with free places
for var x := 1 to 20
	for var y := 1 to 13
		tFreePlaces.writeRow(1, tFreePlaces.yDim + 1, "left", x, y)
		tFreePlaces.writeRow(1, tFreePlaces.yDim + 1, "right", x, y)
	next
next

THen your getFreeLocation method looks like this, e.g.:

(byref xPos, yPos : integer;
	byref orderside : string)
is
    randRow : integer;
    
do -- #ad# --------------------------------------------------------------------------- -- first check if any free places if root.tFreePlaces.empty then promptMessage("No free storage location found for the part "+to_str(@)); debug; return; end; -- get a random row = random place (69 = some randomnumber stream) randRow := ceil(z_uniform(69, 0, root.tFreePlaces.yDim)); -- read the place information xPos := root.tFreePlaces["XPos", randRow]; yPos := root.tFreePlaces["yPos", randRow]; orderside := root.tFreePlaces["Side", randRow]; -- delete this row, the place is no longer free root.tFreePlaces.cutRow(randRow); -- save the place information together with the stored MU root.tStoredMUs.writeRow(0, root.tStoredMUs.yDim + 1, @, orderside, xPos, yPos); --------------------------------------------------------------------------- #ad# -- end;

Check out the example model. There is something wrong in your model, I always get a DEBUG during init "unknown ordertype".

Also note: once you retrieve an MU from storage, you need to delete the matching row from tStoredMUs and reinsert the data into tFreePlaces like this:

tStoredMUs.cutRow(@)
tFreePlaces.writeRow(1, tFreePlaces.yDim + 1, orderside, xPos, yPos)

Regards,
Alex

___________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Gears Phenom Gears Phenom
Gears Phenom

Don't delete the contents of the row, but remove/cut the whole row! Else the random number function will sometimes return an empty row:

grafik.png

___________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Genius
Genius

Hi,Alex

 

Your answers are what i really want ,i feel great glad to see them.

I will review them carefully.

It needs great patience and some time to program this method and post it.

Here,give my best regards to you!

 

Betreff: How to set the storage strategy of “Random” when I put parts into genericRacks(the objects

Gears Phenom Gears Phenom
Gears Phenom
Thanks for the kind words and the kudos Smiley Happy ^^
___________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!