Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Scheduling a processing plant- suggestions (Read 6245 times)
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Scheduling a processing plant- suggestions
Dec 7th, 2010 at 2:52pm
Print Post  
Hi Meppy,
I would appreciate your advice on how to proceed with my project. I hope my question is not redundant and that your response may be useful to other users. I am sure my application is very typical (but I did not see what I needed in the tutorials).

I am creating a scheduling program for a processing plant. I will be importing their customer orders and using their bill of materials to define a process schedule to fulfill the order. There are up to 24 work centers (resources) that need scheduling and for each ordered item there may be up to 5 levels of processing each flowing linearly from one work center to the next time-wise. Also each work center has its own defined work day with breaks and multiple shifts.

So I need to create an initial schedule programmatically from the orders and then allow the planner to modify the schedules graphically via drag and drop. I will maintain the schedule in a separate database where I am tracking other production acitivity as well.

I am not looking for you to write my application but rather give me a thumbnail sketch (flow chart) of how best to use MindFusion Scheduling to implement my project. Perhaps I can discover most of this from the help file and trial and error but your assitance will give me a head start.

Just to let you know where I am so far...it seems the Schedule class would be the place to begin. I would create items with start/end times and use the GetFreePeriod to find slots for new items. Once I have all the items scheduled via this class, I could read them back into my database and then use them for the planner's activities using the timetable calendar view.

I do not know if that is the way to start. Also I do not know how to handle the work schedule (i.e. lunch, breaks, work hours and non-work hours etc.), how to show the planner the schedule for one work center over several days or all work centers on a given day or one order's schedule. You advice on how to do these actions is greatly appreciated.

Again, I am not asking you to provide detail code but just point me to the right classes and properties/methods and a suggestion how to use them. I think you have a great product! I reviewed the competition and none came close to providing what MindFusion Scheduling provides (at least as far as my needs are concerned).

Thanks for all your help (PS...that is another reason I choose MindFusion, your responses to questions have been timely and very thorough).

John
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Scheduling a processing plant- suggestions
Reply #1 - Dec 8th, 2010 at 8:09am
Print Post  
As you have figured, you have to define the plants as resources and group the calendar by these resources. It is up to you however to decide which views to use. You can use the Timetable view to simultaneously display the activities for several resources over one or more days. You can use the Resource view to display the schedule of several resources over arbitrary interval of time. You can also switch between views when the user performs certain actions.

You can handle the work schedules by implementing custom rendering of cells if you want to visually indicate breaks, work and non-work hours etc. The specifics of the implementation depend on the calendar view you will be using. You have to set the appropriate value to the Calendar.CustomDraw property to indicate which parts of the view you want to custom-draw, then handle the Calendar.Draw event to perform the drawing itself. In addition to the visual indication you can also prevent users from dragging items over specific cells by handling the ItemModifying event. The whole scenario is demonstrated in the Zones sample, you can check it out.

Regarding the database serialization - a typical implementation is the following. At the start of the application load the data (plants/bills) from the database to the Calendar control. Then the users visually perform modifications of the data by rescheduling items, adding plants etc. At the end, store the modified data back to the database. You can probably use the GetFreePeriod method if you need to schedule items programmatically.

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: Scheduling a processing plant- suggestions
Reply #2 - Dec 8th, 2010 at 3:30pm
Print Post  
Hi Meppy,
Thank you for your speedy reply. It did help. I will just have to ask specific questions as I go. My problem is that your product is so powerful and feature rich it is hard to know what to use when. But I am sure that becomes second nature as I get into it. And I will have to work through more of the tutorials to learn.

I have a question about GetFreePeriod. Using tutorial one as my starting point, I modified the code as shown below. What I am trying to do is create two appointments. One has a resource and the other does not. I then have 2 buttons. One to get free period without regard to resource. And one to get free period relative to the assigned resource.

The first button getting free period without regard to resource works fine. It reports a start time at the end of the second appointment as I expected.

But the one for free period based on the resource, gives the same start time as the first appointment. I expected it to give me the end time of the first appointment. So I must be missing a setup somewhere. Please advise.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

calendar.BeginInit()
calendar.TimetableSettings.Dates.Clear()

Dim i As Integer
For i = 0 To 5

calendar.TimetableSettings.Dates.Add( _
DateTime.Today.Add(New TimeSpan(i, 0, 0, 0)))

Next i
Dim app As New Appointment()
app.HeaderText = "Meet George"
app.DescriptionText = "This is a sample appointment"
'app.StartTime = New DateTime(2006, 1, 10, 14, 0, 0)
'app.EndTime = New DateTime(2006, 1, 10, 16, 30, 0)
Dim startTime As Date = CDate(Format(Now, "MM/dd/yyyy") & " 01:00")
app.StartTime = startTime
app.EndTime = DateAdd(DateInterval.Minute, 210, startTime)
'app.Style.Brush = New MindFusion.Drawing.SolidBrush(Color.LightGreen)
'app.SelectedStyle.Brush = New MindFusion.Drawing.SolidBrush(Color.Red)
app.Id = "1234"

Dim theResource As New MindFusion.Scheduling.Resource
theResource.Id = "900009"
theResource.Name = "Labeling Line"
theResource.Tag = "900009"
app.Resources.Add(theResource)
calendar.Schedule.Items.Add(app)
calendar.Schedule.Resources.Add(theResource)

Dim app2 As New Appointment()
app2.HeaderText = "Appt with no resouce"
app2.DescriptionText = "This is a sample appointment without a resource assigned."
'app.StartTime = New DateTime(2006, 1, 10, 14, 0, 0)
'app.EndTime = New DateTime(2006, 1, 10, 16, 30, 0)
Dim startTime2 As Date = DateAdd(DateInterval.Minute, 300, startTime)
Dim endTime2 As Date = DateAdd(DateInterval.Minute, 20, startTime2)
app2.StartTime = startTime2
app2.EndTime = DateAdd(DateInterval.Minute, 210, startTime2)
'app.Style.Brush = New MindFusion.Drawing.SolidBrush(Color.LightGreen)
'app.SelectedStyle.Brush = New MindFusion.Drawing.SolidBrush(Color.Red)
app2.Id = "5678"
calendar.Schedule.Items.Add(app2)

calendar.Schedule.Items("1234").Style.Brush = New MindFusion.Drawing.SolidBrush(Color.Green)
calendar.Schedule.Items("1234").SelectedStyle.Brush = New MindFusion.Drawing.SolidBrush(Color.CadetBlue)

calendar.TimetableSettings.VisibleColumns = 3

calendar.EndInit()

End Sub

Private Sub btnGetNextAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetNextAll.Click
Dim theInterval As New TimeSpan(0, 40, 0, 0)
Dim startTime As Date = CDate(Format(Now, "MM/dd/yyyy") & " 01:00")
Dim endTime As Date = DateAdd(DateInterval.Day, 5, startTime)
MessageBox.Show(Me.calendar.Schedule.GetFreePeriod(startTime, endTime, theInterval))
End Sub

Private Sub btnGetNextResource_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetNextResource.Click
Dim theResources As New MindFusion.Scheduling.ResourceCollection
Dim theResource As New MindFusion.Scheduling.Resource
theResource.Id = "900009"
theResource.Name = "Labeling Line"
theResource.Tag = "900009"
theResources.Add(theResource)
Dim theInterval As New TimeSpan(0, 40, 0, 0)
Dim startTime As Date = CDate(Format(Now, "MM/dd/yyyy") & " 01:00")
Dim endTime As Date = DateAdd(DateInterval.Day, 5, startTime)
MessageBox.Show(Me.calendar.Schedule.GetFreePeriod(startTime, endTime, theInterval, theResources))
End Sub
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Scheduling a processing plant- suggestions
Reply #3 - Dec 8th, 2010 at 3:48pm
Print Post  
The GetFreePeriod method matches resources by reference. Therefore the newly created resource, although identical to the original one, is still interpreted as a different resource by the method. Pass a reference to the original resource instead of creating a new one:

Code
Select All
theResources.Add(calendar.Schedule.Resources(0)) 


Let me know if this works.

Regards,
Meppy
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: Scheduling a processing plant- suggestions
Reply #4 - Dec 8th, 2010 at 4:10pm
Print Post  
Thanks Meppy,
That worked great! You know what...we need a "MindFusion For Dummies" book LOL.

John
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: Scheduling a processing plant- suggestions
Reply #5 - Dec 10th, 2010 at 3:29pm
Print Post  
Hi Meppy,
Thank you for all your help. I need to see if I can use the GetFreePeriod to solve my problem. I hope I state it clearly:

I have 3 identical machines. I want to find within my date range the first free period that meets the required processing time on any one of the 3 machines that are currently scheduled to run the product I am scheduling and if none of the machines are scheduled to run the product during my date range, then I want the first free period on any of the machines.

I had thought to put the 3 machines into a resources collection and call GetFreePeriod, but I do not know if GetFreePeriod would assume all 3 resources are required by the process or that any one of the resources is required. But even if that works, I do not know how to associate the existing scheduled products to get the period I want.

Is this possible with the schedule class or do I have to build my own routine to do this?

Thanks,
John
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Scheduling a processing plant- suggestions
Reply #6 - Dec 10th, 2010 at 3:42pm
Print Post  
Hi John,

Probably make 3 separate calls of the GetFreePeriod method for each of the machines individually. Then use the earliest of the three returned intervals. Or perhaps make consecutive calls for each of the machines until you find a suitable free period - that is, if the first machine finds a free period, you schedule the activity on this machine. If not, you attempt to schedule the activity on the next machine etc. Of course using the consecutive approach does not guarantee that the activity will be scheduled as early as possible.

Will that work?

Regards,
Meppy
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: Scheduling a processing plant- suggestions
Reply #7 - Dec 10th, 2010 at 4:17pm
Print Post  
Hi Meppy,
That will get me the earliest free period matching my time requirements but it does not address whether the prior scheduled item was the same product that I am trying to schedule. So I want the first free period on the machine that is processing the product I am scheduling but if none of the machines are scheduled for the product, then I will use the first free period.

Does that make sense?

John
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Scheduling a processing plant- suggestions
Reply #8 - Dec 11th, 2010 at 7:35am
Print Post  
Can't you then just call GetFreePeriod passing a reference to the machine of interest (the one that is processing the product you are scheduling)?

Regards,
Meppy
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: Scheduling a processing plant- suggestions
Reply #9 - Dec 12th, 2010 at 3:46am
Print Post  
The problem is that the machine may process several different products and I want to group them by product to get larger runs. So I want to find the free period not only matching the start/stop limits, total time required and machine, but also by product if that machine has any scheduled. The more I think about this, the more I believe I need to do a custom "getfreeperiod" routine in my code.

Thanks again for your speedy and excellent responses. I am sure I will have more questions as I delve deeper into your fine product.

John
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint