View Full Version: Precedence relationaship problem...

C++ Learning Community > C++ Help > Precedence relationaship problem...


Title: Precedence relationaship problem...
Description: it is a great problem to solve


CheeSoon - January 30, 2007 09:04 AM (GMT)
i face a problem in my thesis, ya!i'm a university student..
do you heard about precedence relationship? ranked positional weight?
ya!i need to build a program to run the algorithm by using C++.
this is a job sequence table:

work precedence element
a --
b a
c a
d b,c
explanation:
work a can do without any constraint. before doing work b or work c, work a must be done. before doing work d, work b & c must be done.

by this rules, we know that the work sequence must be as shown in the diagram.
we do
this is the diagram:

a --> b -->
--> c --> d

explanation:
1st, we do work a, after that we do work b and work c at the same time by different machine. after both work b and c did, we do work d.

let say to do the work need time as shown below (user key in)
a - 5 minutes
b - 3 minutes
c - 4 minutes
d - 1 minutes

my problem now is, based on the sequence table as shown above(user key in),
how can we compute the RPW value. RPW value is the total time need for the work itself plus the time for all the work after it.
answer should be:
RPW a = a+b+c+d = 13
RPW b = b+d = 4
RPW c = c+d =1
RPW d = d =1

so..do you have any idea to solve it?



Shonoby - January 31, 2007 12:40 AM (GMT)
Well, i don't completely understand what u mean. But one thing u could do to solve this, is create the work a, b, c, d individually as private members, of class Work. When this is done u have to create a member function in the public part of Work, to give each of these work values there properties. After you are done with, in main() you should create a algo, that knows which worker to choose at the appropriate time. If your a university student you should know enough about C++, to make this run. :P :lol:

P.S. Like myork said we don't do homework, but i am only helping you cause, well it seems like a challenge to me. Well, anyways, are u sure ur a university student, cause it does not seem like it but then again i might not understand the complexity of this problem, eehh whatever <_< .

Zaqufant - January 31, 2007 12:52 AM (GMT)
I have no idea what you're trying to solve, but you could create a class called Task. And in the Task class, you have each of the elements of this problem. Then you have another class called TaskList. This class is just the group of of the work group, plus the algorithm. That's how i'd go about and figure it out.




Hosted for free by InvisionFree