Notices
Results 1 to 1 of 1

Thread: need help on algorithm

  1. #1 need help on algorithm 
    New Member
    Join Date
    May 2010
    Posts
    1
    hi all...this is my first time here.
    i have this problem.which is related to generator,item,binary setting and input. i have a lot of conditions where generators from 2 to 6 with different binary setting.
    generator 2: needs 3 or more items
    generator 3: needs 4 or more items
    generator 4: needs 5 or more items
    generator 5:needs 6 or more items
    generator 6: needs 7 or more item.

    user just need to key in the input and select generator....

    items is depend on input.the example is like this:


    Input [0] [1] [2] [3]
    [0] a0 b0 c0 d0
    [1] a1 b1 c1 d1
    [2] a2 b2 c2
    [3] a3
    item 1 2 3 4
    Generator=2
    Bi set
    0 0 1 1
    O/p X X c0 d0
    X X c0 d1
    X X c1 d0
    X X c1 d1
    X X c2 d0
    X X c2 d1

    Binary setting
    0 1 0 1
    O/p X b0 X d0
    X b0 X d1
    X b1 X d0
    X b1 X d1
    X b2 X d0
    X b2 X d1

    Binary setting
    0 1 1 0
    O/p X b0 c0 X
    X b0 c1 X
    X b0 c2 X
    X b1 c0 X
    X b1 c1 X
    X b1 c2 X
    X b2 c0 X
    X b2 c1 X
    X b2 c2 X

    Binary setting
    1 0 1 0
    O/p a0 X c0 X
    a0 X c1 X
    a0 X c2 X
    a1 X c0 X
    a1 X c1 X
    a1 X c2 X
    a2 X c0 X
    a2 X c1 X
    a2 X c2 X
    a3 X c0 X
    a3 X c1 X
    a3 X c2 X

    Binary setting
    1 1 0 0
    O/p a0 b0 X X
    a0 b1 X X
    a0 b2 X X
    a1 b0 X X
    a1 b1 X X
    a1 b2 X X
    a2 b0 X X
    a2 b1 X X
    a2 b2 X X
    a3 b0 X X
    a3 b1 X X
    a3 b2 X X

    Binary setting
    1 0 0 1
    O/p a0 X X d0
    a0 X X d1
    a1 X X d0
    a1 X X d1
    a2 X X d0
    a2 X X d1
    a3 X X d0
    a3 X X d1

    Generator=3
    Binary setting
    0 1 1 1
    O/p X b0 c0 d0
    X b0 c0 d1
    X b0 c1 d0
    X b0 c1 d1
    X b0 c2 d0
    X b0 c2 d1
    X b1 c0 d0
    X b1 c0 d1
    X b1 c1 d0
    X b 1 c1 d1
    X b 1 c2 d0
    X b 1 c2 d1
    X b 2 c0 d0
    X b 2 c0 d1
    X b 2 c1 d0
    X b 2 c1 d1
    X b 2 c2 d0
    X b 2 c2 d1


    Binary setting
    1 1 1 0
    O/p a0 b 0 c0 X
    a0 b0 c1 X
    a0 b0 c2 X
    a0 b1 c0 X
    a0 b1 c1 X
    a0 b1 c2 X
    a0 b2 c0 X
    a0 b2 c1 X
    a0 b2 c2 X
    a1 b0 c0 X
    a1 b0 c1 X
    a1 b0 c2 X
    a1 b1 c0 X
    a1 b1 c1 X
    a1 b1 c2 X
    a1 b2 c0 X
    a1 b2 c1 X
    a1 b2 c2 X
    a2 b0 c0 X
    a2 b0 c1 X
    a2 b0 c2 X
    a2 b1 c0 X
    a2 b1 c1 X
    a2 b1 c2 X
    a2 b2 c0 X
    a2 b2 c1 X
    a2 b2 c2 X
    a3 b0 c0 X
    a3 b0 c1 X
    a3 b0 c2 X
    a3 b1 c0 X
    a3 b1 c1 X
    a3 b1 c2 X
    a3 b2 c0 X
    a3 b2 c1 X
    a3 b2 c2 X

    Binary setting
    1 0 1 1
    O/p a0 X c0 d0
    a0 X c0 d1
    a0 X c1 d0
    a0 X c1 d1
    a0 X c2 d0
    a0 X c2 d1
    a1 X c0 d0
    a1 X c0 d1
    a1 X c1 d0
    a1 X c1 d1
    a1 X c2 d0
    a1 X c2 d1
    a2 X c0 d0
    a2 X c0 d1
    a2 X c1 d0
    a2 X c1 d1
    a2 X c2 d0
    a2 X c2 d1
    a3 X c0 d0
    a3 X c0 d1
    a3 X c1 d0
    a3 X c1 d1
    a3 X c2 d0
    a3 X c2 d1

    Binary setting
    1 1 0 1
    O/p a0 b0 X d0
    a0 b0 X d1
    a0 b1 X d0
    a0 b1 X d1
    a0 b2 X d0
    a0 b2 X d1
    a1 b0 X d0
    a1 b0 X d1
    a1 b1 X d0
    a1 b1 X d1
    a1 b2 X d0
    a1 b2 X d1
    a2 b0 X d0
    a2 b0 X d1
    a2 b1 X d0
    a2 b1 X d1
    a2 b2 X d0
    a2 b2 X d1
    a3 b0 X d0
    a3 b0 X d1
    a3 b1 X d0
    a3 b1 X d1
    a3 b2 X d0
    a3 b2 X d1



    Example for generator more than 3.
    *must have more than 3 input a,b,c and d and can be more.

    Input (example)
    Items 1 2 3 4 5
    a0 b0 c0 d0 e0
    a1 b1 c1 d1 e1
    b2 d2

    Gen Binary setting
    3 0 0 1 1 1
    0 1 0 1 1
    0 1 1 0 1
    0 1 1 1 0
    1 0 0 1 1
    1 0 1 0 1
    1 0 1 1 0
    1 1 0 0 1
    1 1 1 0 0

    4
    0 1 1 1 1
    1 0 1 1 1
    1 1 0 1 1
    1 1 1 0 1
    1 1 1 1 0
    [/code]
    to get binary setting actually depends on how many items and what is generator selected.the number of '1' in binary setting is equal to the number of generator.
    5 and 6 are not allowed to generate the output with this input because item is only 5.

    the problem is i dont know how to relate input and binary setting.i have no problem to get binary setting,generator and input.


    Reply With Quote  
     

  2.  
     

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