| Quintiq file version 2.0 | 
| #parent: #root | 
| Method Setup ( | 
|   String description, | 
|   String strategydescription | 
| ) | 
| { | 
|   Description: 'Maintain by R&D' | 
|   TextBody: | 
|   [* | 
|     // jasperb Feb-22-2012 (created) | 
|      | 
|     if( this.BenchmarkProblemId() = - 1 ) | 
|     { | 
|       error( 'BenchmarkUtilities::BenchmarkProblem was not called or failed' ); | 
|     } | 
|      | 
|     if( this.SetupId() <> -1 ) | 
|     { | 
|       error( 'BenchmarkUtilities::Setup was called already' ); | 
|     } | 
|      | 
|     machine := OS::ComputerName(); | 
|     quintiqversion := Kernel::Version(); | 
|     modelversion := DomainModel::Domain().Version().Version(); | 
|      | 
|     if( this.AutoSave() ) | 
|     { | 
|       //TODO check if save is needed, now always saving and incrementing version number | 
|      | 
|       info( DomainModel::Domain().Version().Version() ); | 
|      | 
|       //force save also do DomainModel::Domain().IOManager().WriteAll(); | 
|       ok := DomainModel::Domain().PersistencyManager().Export(); | 
|       info( 'DomainModel::Domain().PersistencyManager().Export():', ok ); | 
|      | 
|       info( DomainModel::Domain().Version().Version() ); | 
|     } | 
|      | 
|     if( this.ExportQPA() ) | 
|     { | 
|       error( 'Exporting QPA not supported in Quintiq 5.0' ); | 
|     } | 
|      | 
|     /* Read .qpa/.qproject info from "cfg" file */ | 
|     modelfilename := BenchmarkUtilities::GetStringFromFile( 'modelfilename' ); | 
|     pyscriptfilename := BenchmarkUtilities::GetStringFromFile( 'pyscriptfilename' ); | 
|     runscriptfilename := BenchmarkUtilities::GetStringFromFile( 'runscriptfilename' ); | 
|      | 
|     basedir := BenchmarkUtilities::GetQuintiqBaseDir(); | 
|     BenchmarkUtilities::MakeSQLCompatible(basedir); | 
|     BenchmarkUtilities::MakeSQLCompatible(modelfilename); | 
|     BenchmarkUtilities::MakeSQLCompatible(pyscriptfilename); | 
|     BenchmarkUtilities::MakeSQLCompatible(runscriptfilename); | 
|      | 
|     setupid := this.GetOrCreate( "setup", | 
|                                  "benchmarkproblemid,machine,quintiqversion,modelversion,modelfilename,description,strategydescription,quintiqbasedir,pyscriptfilename,runscriptfilename", | 
|                                  "", | 
|                                  [String] this.BenchmarkProblemId() + ",'" + machine + "','" + quintiqversion + "','" + modelversion + "','" + modelfilename + "','" + description + "','" + strategydescription + "','" + basedir + "','" + pyscriptfilename + "','" + runscriptfilename + "'", | 
|                                  "" ); | 
|     this.SetupId(setupid); | 
|   *] | 
| } |