Discrete Process Simulation

(Tools: Input)







Simulations often need a lot of input data. To support a readable ASCII input format, a class "TomasFile" is defined. TomasFile supports almost all value and character types of Delphi. Based on the assumption that the programmer knows the input format, all conversions, spacing, linefeeds and comments are handled by TomasFile. Assume we made a general model for a job shop with a variable number of departments, each with a number of machines and a distribution for the execution time. One example of an input file ("jobshop.txt") is given below.

'Milling' 3 {name of department and number of machines}
'normal(5,1)' {distribution of execution time}
'Welding' 5

The part of the program to read this file will look like:

While NOT(InputFile.FileMarker) Do

  • Department:=TDepartment.Create(InputFile.GetString);
  • Department.NrOfMachine:=InputFile.GetInteger;
  • Department.ExecTime:=TInputDistribution.Create(InputFile.GetString);