I have a sequecing problem in VBA. I currently have a random data set of S,D, and H, with a date and time attached to each element. The sequencing rules are the following:
H cannot be beside another H
H's should ideally be surrounded with S's
S's have no restrictions, but should be evenly distributed within the data set.
Two D's should ideally not be beside each other but can be if necessary.
D and H should ideally not be beside each other.
If there is absolutely no other way, the first rule can be broken.
As for the dates, there is a starting date and time attached to the data set. The dates for each element has to be in sequence, and there is a window of -2 to 12 hours that you can play with for each part.
To clarify the above, the sequencing rules above is in a top-to-bottom priority list.
So the priority sequence is:
SHS > SDS > SS > DD > DH > HH
Also in regards to the window, by +12 I mean 12 hour lead time, so the part should be 12 hours earlier than the given date/time and -2 means the part could be delayed by 2 hours from the given date / time. If the best move requires a delay of 4 hours, it will be no good, as it breaks the time constraints.
An additional request is to reassign new date/times after the resequence. Ideally I would like a variable time difference between each part, so the part should be resequenced with the new time assignment in mind.
E.g. If each row movement represents an hour change, if one part requires a 1 hour lead time before the next part, you can move that part around 12 rows above, or 2 rows below its original position. If another part requires a 2 hour lead time before the next part, you can only move that row 6 rows above or 1 row below. Or something to that effect.
2 freelancere byder i gennemsnit $128 for dette job
Hello, Client! I have read your description carefully I have interest in your job I have many experience in EXCEL/VBA If I award me, then I can finish it in 2 days I hope you send me message thanks Best regards