4. File format (BNF)

Definitions in BNF (Backus normal form): https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form

RESULTS FILE (Content definition (csv file))

<ResultFile> ::= <LeadLines> <TitleLine> <ResultLines>

<LeadLines>  ::= <Author> <Reference> <Date> <Hardware>

 <StopCriteria> <SubmissionDate>

<Author>     ::= “# Author(s);” <TextValue> <EOL>

<Reference>  ::= “” | “# Reference;” <TextValue> <EOL>

<Date>       ::= “” | “# Date;” <TextValue> <EOL>

<Hardware>   ::= “” | “# Hardware / software;” <TextValue> <EOL>

<StopCriteria> ::= “” | “# Stop criteria;” <TextValue> <EOL>

<SubmissionDate> ::= “” | “# Submission date;” <TextValue> <EOL>

<TitleLine>  ::= “” | “ID;Type;Value;Time” <EOL>

               | “ID;Type;Value;Time;Solution” <EOL>

<ResultLines>::= “” | <ResultLine> <EOL> <ResultLines>

<ResultLine> ::= <Id> “;” <Type> “;” <Value> “;”

                <Time> <Solution>

<Id>         ::= <IntValue> | <Filename>

<Type>       ::= "lower bound" | "heuristic" | "optimal"

<Value>      ::= <IntValue>

<Solution>   ::= “” | “;” <SolutionSM> | “;” <SolutionMM>

<SolutionSM> ::= <ST0> “;” <ST1> “;” ... “;”

                <STn> “;” <STn+1> <EOF>

<SolutionMM> ::= <Mod1> “;”... “;” <Modn> “;” <SolutionSM>



<EOL>  - end of line specified

<TextValue> - text value for describing the data

<IntValue> - integer value corresponding to the field

<FileName> - valid file name in the operating system

<Id> - can be the ID on the dataset, or the file name

<Time> - time in milliseconds

<STk>  - start time of activity k

<Modk> - mode of activity k


DATASET FILE (Content definition for the initial file starting file. The tool initiates the rest of the data (csv file))

<DatasetFile> ::= <LeadLines> <TitleLine> <DataLines>

<LeadLines>   ::= <Title> <Description> <NumberInst> <Format>

<Title>       ::= “Title;” <TextValue> <EOF>

<Description> ::= “” | “Description;” <TextValue> <EOF>

<NumberInst>  ::= “” | “Number;” <IntValue> <EOF>

<Format>      ::= “Format;” <ValidEXT> <EOF>

<ValidEXT>    ::= “sm” | “mm” | “rcp” | “prb” | “rcp+res”

                | “rcs”

<TitleLine>   ::= "ID;Ref1;Ref2;Ref3;LB value;LB time;LB ref;UB value;UB time;UB ref;OPT value;OPT time;OPT value"

<DataLines>   ::= “” | <DataLine> <EOL> <DataLines>

<DataLine>    ::= <Id> “;” <Ref1> “;0;0;0;0;0;0;0;0;0;0;0”

                | <Id> “;” <Ref1> “;” <Ref2> “;” <Ref3>


<Id>          ::= <IntValue>

<Ref1>        ::= <FileName>

<Ref2>        ::= <FileName>

<Ref3>        ::= <IntValue>


Extra notes:

     <Id> - incremental integer, should be from 1 up to the number of instances

     <Ref1> - file with the instance

     <Ref2> - if used, is the file with the resource set

     <Ref3> - the parameter for select the resource profile

     <ValidEXT> - the format is "sm" or "mm" for PSPLIB format, "rcp" for Patterson format, "prb" for Boctor format, "rcs" for SATRCSP format (SAT and Paterson formats), and “rcp+res” for specifying the network (in Patterson format), and the resource profile, in different files.


Tool line command format:

<SolUp>      ::= <NoArgs> | <Stats> | <Update> | <Generate>

               | <Subset>

<NoArgs>     ::= “SolutionsUpdate”

<Stats>      ::= <NoArgs> <SP> <DatasetFile>

                 <ExtraStats> <NotSimplify> <Datapath>

<DatasetFile>::= <Filename> “.csv”

<ExtraStats> ::= “” | <SP> “reset”

<NotSimplify>::= “” | <SP> “notSimplify”

<Datapath>   ::= “” | <SP> “dataPath:” <Filepath>

               | <SP> “dataPath:” <Filepath> “:” <Filepath>

<Update>     ::= <NoArgs> <SP> <DatasetFile> <SP> <ResultFile>

                 <ExtraUpdate> <NotSimplify> <Datapath>

<ResultFile> ::= <Filename> “.csv”

<ExtraUpdate>::= “” | <SP> “noSolutions”

               | <SP> “checkSolution:” <IntValue>

               | <SP> “PSPLIB” | <SP> “MMLIB”

<Generate>   ::= <NoArgs> <SP> <DatasetFile> <SP> <FileName>

                 <NotSimplify> <Datapath>

<Subset>     ::= <NoArgs> <SP> <DatasetFile> <SP> <NewDataset>

                 <Instances> <NotSimplify> <Datapath>

<NewDataset>::= <Filename> “.csv”

<Instances>  ::= <NumberSet> | “open” | “closed”

<NumberSet>  ::= <NumberRange> | <NumberRange> “;” <NumberSet>

<NumberRange>::= <IntValue>

              | <IntValue> “-“ <IntValue>

              | <IntValue> “-“ <IntValue> “:” <IntValue>



<Stats> - show current statistics of a dataset, if used “reset” will initiate the dataset (or if the dataset is empty). The “notSimplify” turn off removal of irrelevant resources, activity modes and dummy activity modes in the middle of the instance. The datapath, if not given and is required to open an instance file, will be asked to the user.

<Update> - will update the dataset with the results file indicated. Can be relaxed the solution validation, or can be forced to check a specific solution (instance ID). The PSPLIB and MMLIB keywords should be used when updating results from this datasets, so files can be generated to update the websites of these datasets.

<Generate> - will generate instances, and the filename should have no extension, since files will be created starting with the filename, adding the instance ID and file extension.

<Subset> - if the “open” or “closed” keyword is specified, in the subset will be just the open/closed instances. Otherwise will be the instances ID that belong to the number set. The number set can be a sequence of numbers, but can be specified number ranges like 1-10 meaning the numbers from 1 to 10, that can include septs, like 1-10:2 meaning the numbers 1; 3; 5; 7; 9.

<SP> - any space separator between arguments

<NoArgs> - show the help text

<Filename> - valid filename


INSTANCE FILE (Format definition of a file in Patterson format (rcp file))

<PattersonFormat> ::= <valueN> <SP> <valueR> <SP>

                      <ResCapacity> <Activities>

<ValueN>          ::= <IntValue>

<ValueR>          ::= <IntValue>

<ResCapacity>     ::= <RC_1> ... <RC_R>

<RC_k>            ::= <IntValue> <SP>

<Activities>      ::= <Act_1> ... <Act_N>

<Act_k>           ::= <ProcessingTime_k> <ResUsage_k> <Sucs_k>

<ProcessingTime_k>::= <IntValue> <SP>

<ResUsage_k>      ::= <RU_k_1> ... <RU_k_R>

<RU_k_r>          ::= <IntValue> <SP>

<Sucs_k>          ::= <NumberSucs_k> <Suc_k_1> … <Suc_k_W> <EOL>

<NumberSucs_k>    ::= <IntValue> <SP>

<Suc_k_w>          ::= <IntValue> <SP>



<SP> - any sequence of space characters (including tabs, and end of lines characters

Indexes N and R correspond to <valueN> and <valueR>

     Index W correspond to the <NumberSucs_k>

     Index k and w correspond to any valid value