D
Darius Fatakia
Hello,
I have a file that I have opened for reading and this file contains lines
with several different types of constraint information.
For example, here are a few lines:
length(0) = 10 Duration of task 0 is 10.
needs(16,1) Operation 16 uses resource 1.
before(49,9) Operation 49 must be before operation 9.
release(17) = 0 Operation 17 can start at or after time 0.
due(0) = 149 Operation 0 must be done no later than time 149.
The part before the parentheses is the constraint_type (a string) and then i
have either one or 2 parameters (both integers) inside the parentheses, and
then possibly (for due, release, and length) an integer value.
I am wondering what the best way to parse this input would be, given that I
don't know what type of constraint I will encounter when I read in the line.
Thanks!
~Darius
I have a file that I have opened for reading and this file contains lines
with several different types of constraint information.
For example, here are a few lines:
length(0) = 10 Duration of task 0 is 10.
needs(16,1) Operation 16 uses resource 1.
before(49,9) Operation 49 must be before operation 9.
release(17) = 0 Operation 17 can start at or after time 0.
due(0) = 149 Operation 0 must be done no later than time 149.
The part before the parentheses is the constraint_type (a string) and then i
have either one or 2 parameters (both integers) inside the parentheses, and
then possibly (for due, release, and length) an integer value.
I am wondering what the best way to parse this input would be, given that I
don't know what type of constraint I will encounter when I read in the line.
Thanks!
~Darius