Consulting

Results 1 to 9 of 9

Thread: Random Sequencing

  1. #1

    Random Sequencing

    Hello all,


    I am looking for help with this vba problem i have.


    I have a system that accepts 3 types of demand in bulk. Each bulk has quantities in it. I have been able to split this quantities randomly from 1 to 5 splits before going into the system sequencially. But now i want these splits to go in a random sequence with no same type following each other.
    For example


    Type 1: 5 quantities; splitted into 2,3
    Type 2: 7 quantities; splitted into 3,4
    Type 3: 6 quantities; splitted into 1,1,1,1,2


    And they go into the system in that sequence: 2,3,3,4,1,1,1,1,2


    But i want to sequence to be random with no two of the same type following each other.


    Please how can I achieve this with code.


    Thanks

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    That's a lot of code. And there are conditions that can make the second requirement impossible to meet. Ie. You receive two bulks and split them into 2 and 5 quantities.

    Even if we develop code that will work with pure numbers, that doesn't mean it will work in your system of accepting demand in bulk.

    If we can do this, you must provide much more information about the whole process.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    hello SamT,
    thanks for your response, i am trying to upload an excel file for clarification but i don't seem to find where to upload it here.

  4. #4
    hello please find attached file for some clarification

    thanks
    Attached Files Attached Files

  5. #5

    Sequence problem

    I created a process simulation using excel vba that chooses number of items from type 1 to number of types. I generate a random split between 2 and number of splits of each type. But the splits get executed sequentially from type 1, 2, ....


    Is there a way to make split execute randomly with different results every time and doesn't repeat the same type except no split of other type left to randomise with. Also, first type not necessarily be the first to execute and the last not necessarily the last to execute.


    I could't begin to think of what is the syntax to begin with.


    For instance:
    Type 1, 10 items of splits 2,1,2,5
    Type 2, 5 items of splits 2,3
    Type 3, 7 items of splits 2, 2, 3


    Currently the process execute in (T1,2) (T1,1) (T1,2) (T1,5); (T2,2) (T2,3) ;(T3,2) (T3,2) (T3,3)
    Intended process execution (T1, 2) (T2,2) (T1,1) (T3,2) (T2,3) (T1, 2) (T3, 2) (T1, 5) (T3, 3)

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Please do not start duplicate threads about the same problem.

    Thank you.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    See attached.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  8. #8

  9. #9
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    And two threads here.

    We'll watch him. Closely.

    @ victor222:
    Read carefully and follow the link therein: What is multiposting?

    No more warnings.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •