A4: Variable filenames

Top  Previous  Next

Solution: Task 4

 

Open simplace_modules\test\training\solution\1_WorkingWithSolutions\01_FirstSolution.sol.xml file.

 

Create a new variable named "vLocation" (it can be any name) in variables section(<variables></variables>), e.g.:

<variables>

  <var id="startdate" datatype="DATE">01.01.1982</var>

  <var id="enddate" datatype="DATE">31.12.1988</var>

  <var id="vLocation" datatype="CHAR" description="key to select corresponding weather file (W)">weather1</var>

</variables>

 

Now use 'vLocation' variable in the weatherfile interface:

 

   <interface id="weatherfile" type="CSV">

    <poolsize>2</poolsize>

    <divider />

    <filename>${_WORKDIR_}/training/data/lintul/${vLocation}.txt</filename>

  </interface>

 

And then run the java application file that uses this ModelSolution (If you can't remember how to do it, please see again the first page 1. Running a solution). To make sure that you don't have any mistakes in your solution, check the output file in the simplate_modules/output/training folder.