Jump to content

Searching for alternate function to RandomRow


Recommended Posts

Hello,

I am working on a project that consists of planning of jobs in a flow shop where resources are shared between machines (availability problem). Each resource has its own processing time. The target is: seize the available resource that has the shortest processing time.

I am trying to generate 10 different jobs that should come at once; so, what I did is:

First, I created a DataTable with JobType, JobTypeMix and ProcessingTime;

Second, I set the Interarrival Time to 0 and the Maximum Arrivals to 10;

Third, in The Table Reference Assignments (Resource), I set the Row Number in Before Creating Entities to: JobsTable.JobTypeMix.RandomRow;

Actually, I could not find an alternate function to RandomRow to describe what I want, so I got a mix of random jobs.

Is there any function to address this situation please? I need to get 10 different jobs at once.

Any hint will be truly appreciated. Thanks.

Project.spfx

Link to comment
Share on other sites

I cannot open files with academic license but can help with the problem:


First of all, do not set the interarrival time to 0, that is dangerous, use entities per arrival to have more than one at the same time.


If you set a row on Before Creating Entities, you will get the same row for all entities per arrival. Instead, you should assign jobs On Created Entity, once you already have them. Then you can assign the values to entity states and go forward with processing. For the target, make a queue (storage element) minimizing the processing time and always take the first element.

Link to comment
Share on other sites

I just modified my model but still have some issues; Once I switched JobsTable.JobTypeMix.RandomRow from RowNumber of Before Creating Entities to On Created Entity, I got Error Message (see attached).

Also, I did not your idea: Then you can assign the values to entity states and go forward with processing.

Thanks for your help.

Project.docx

Link to comment
Share on other sites

Ah, so you want to create 10 different entity types at the same simulation time? Why? What is the fundamental difference between them?

Typically, you have 10 initializations of the same type, that you distinguish by giving them various values of state variables, especially in a small model like yours. My suggestion from above will not work.


The error happens because you have not set a row in the table. Make your own add-on process that handles it if you really want to do it like that, I do not think the standard library source supports what you are trying to do. I would seriously rethink your approach though, it does not seem right.


As for states, if you want your entities to have different processing times, the easiest way is to create a state for your ModelEntity that you use as a processing time. It won't automatically read the values from a table without setting the appropriate row, and the entity does not 'remember' it. Well, it can but that would be a bit more difficult.

Link to comment
Share on other sites

Here is a sample model. I set Interarrival Time property to 2 to set the arrivals apart from each other. Note that you can set required number of entities to create by assigning the appropriate value to "TotalNumOfEntitiesToCreate" property. In this sample model I intentionally assigned 10 then a total of 11 entities will be created. In your case you should set the value of "TotalNumOfEntitiesToCreate" to 9 to get a total of 10 entities each time at once. Hope it works for you...

Project.spfx

Link to comment
Share on other sites

Thank you so much guys.

I tried many ways but did not work. Actually, I was looking for creating 10 different entities (jobs) that come to the shop at the same time.

I guess I found an easiest way to do it; I just set 10 different sources with maximum arrivals of 1 each and hit the target.

Now I have to work on how to allocate or seize resources in a specific way; each job has a processing time related to the use of a specific resource. Example, if job A is ready to be processed in server A, the server choose the available resource that has the smallest process time. Same thing to the next servers.

Right now, I am trying to use processes. It should be something like:

Process 1 : Resource1_Allocated : assign – decide – execute

Process 2 : Resource1_Released : assign

Any idea please. Thanks.

Project_June 2016.spfx

Link to comment
Share on other sites

In the model I attached if you set "Maximum Arrivals" property of source object to 1 and "Interarrival Time" property of source object to "0" you can get the same logic. It is unnecessary to include ten source objects in the model. I did not understand what u wnat to do? resource objects has no processing time properties? What do you mean with resource? resource object? Could u state your problem clearly pls?

Link to comment
Share on other sites

Thanks Gochen for your reply. I really appreciate it.

I just rechecked your model but still giving me 10 jobs some of them are duplicated which does not represent 10 different entities (jobs). Anyway, I am going to keep looking for an elegant way to do it based on your hits.

Now, let me explain the next step; since the source problem is solved (at least temporary), now I am going to tackle the server and resource objects. I have 10 different jobs waiting to be processed in front of the first sever in the shop. The server cannot process them without resource such as tool, worker, etc...Each job has a processing time on the server but also depending on the resource. I have attached a doc snapshot if you are not able to open an academic license. The goal is: the server has to seize the available resource that has the smallest processing time in order to process the job.

I found a nice file in the Simbits which is: SeizingSameResourceFromList. It does part of the job but still to be improved. The same allocated resource sticks to the job all the way. In my case, I want the server to choose from the available resource each time the resource is needed.

I hope my explanation was clear enough.

Thank you.

Model Overview.docx

Link to comment
Share on other sites

Hello,

I have made some improvement in my model. It works now but still needs processes to implement the logic that I am looking for: the server seizes the available resource (tool, worker …) that has the smallest processing time. I am providing the model and the table that I am trying to use.

Please, any idea guys. Thanks.

Model 17-06-2016V3.spfx

Untitled.jpg.89cead5e76894090bb13047e72b4e7f6.jpg

Link to comment
Share on other sites

I tried to solve your problem but interestingly I am not allowed to use any modelentity based definitions (i.e., statevariables) in your model. I did not understand what the problem is. I should be able to define such variables and use them within the processes and/or objects. This should be a routine assignment. Is it due to my licence based problem? As far as I know I am using academic version and always just the updated ones. I am complicated. If I can manage to define required modelentity based state variables I will be able to solve your problem. Still I have uploaded my draft model you can trace my solution method. Try the attached model and pls feed me back whether u can define modelentity based definitions.

Project.spfx

Link to comment
Share on other sites

Hello gocken,

It was truly a pleasure to see your answer. Thank you so much.

Regarding modelentity based definitions, I guess it works, see attached, but not sure if that is what you are talking about.

I have tried to understand the model and found:

• The program always picks the second raw from Table1 (processing time) and do not select the smallest processing time. e.g : JobsTypeA gets 3min;

• Resources are not linked to the processing time. e.g : JobsTypeA with R1 should be processed at smallest processing time which is 1min.

Your assistance is really appreciated gocken. Now, I am working on your model to get the logic I am looking for.

All the best.

Untitled1.thumb.jpg.738397f5be657425e716135c7bb2d5ed.jpg

Link to comment
Share on other sites

×
×
  • Create New...