For my term project, I need a simple program but I do not know how to write that with my small knowledge about C/C++. I would be very glad to you if you show me the doors. First of all, I have a permutation of numbers (to represent the works), like [1,5,3,7,8,3,4,2,9] and my aim is to compute the total time because these will have time constraints and resource, constraints. It will be like this:
The program will take work 1 (lets say it needs 5 unit resources and I HAVE 7 UNITS OF RESOURCES TOTAL). Then it will take 5 (lets say resource needed is 4). since I cannot handle both works at the same time it will put the work 5 after work 1 in the time schedule. Then work 3 will be manipulated and lets say it needs 1 unit of resources. then the program will put this work in the schedule at the same time with work 1 since it is feasible. If there is another work like work 7 and needs 1 unit of resource, and also if the work 1 is predecessor of it, it will not be able to be scheduled at the same time with work 1 since it is not feasible but can be scheduled with work 5 since it does not violate the resource and precedence constraints.
How should I write the code? Can you help me with that?
ps: I am trying code just like these flash animations. But I need it in the code Code of any of them is a heaven, but codes both of them are something that I can die for!! Please help me...