esmini icon indicating copy to clipboard operation
esmini copied to clipboard

Is it possible to read parameters from an external file into xosc?

Open fernandoGitHub opened this issue 1 year ago • 2 comments

Currently I'm using ParametersDeclaration for defining the global variables in the xosc. As I want to prepare several permutations of this scenario with different values, I will end up with 20 files looking exactly the same beside the ParametersDeclarations section. For example:

` <ParameterDeclarations> <ParameterDeclaration name="Catalog_Vehicles" parameterType="string" value="../resources/Catalogs/Vehicles"/>

	<!-- Vehicle Types -->
	<ParameterDeclaration name="EgoVehicle"       parameterType="string" value="Police_Car"/>
	<ParameterDeclaration name="Lead_0"           parameterType="string" value="Tesla_3_White"/>
	
	<!-- Initial Speeds -->
	<ParameterDeclaration name="Ego_V0"           parameterType="double" value="35.0"/>
	<ParameterDeclaration name="Lead_0_V0" 	      parameterType="double" value="10.0"/>
	
	<!-- Breaking Parameters -->
	<ParameterDeclaration name="Ego_Deacc"        parameterType="double" value="-8.0"/>
	<ParameterDeclaration name="delta_V"          parameterType="double" value="${$Ego_V0-$Lead_0_V0}"/> 	
</ParameterDeclarations>`

Is there a way to create a file of use cases (or permutations) where each permutation will be defined more or less as:

<Permutation name="P1"> <ParameterDeclaration name="EgoVehicle" parameterType="string" value="Police_Car"/> <ParameterDeclaration name="Lead_0_V0" parameterType="double" value="10.0"/> </Permutation>

So, in my final xosc, I can load the permutation (similar to a Catalog) and use its variables. More or less like:

<ParameterDeclarations> <ParameterDeclaration name="EgoVehicle" parameterType="string" value=<CatalogReference catalogName="VehicleCatalog" entryName="$CarVehicle"/>/> </ParameterDeclarations>

Something like that. Sorry for destroying the structure of the xosc in the example above :-)

fernandoGitHub avatar Aug 28 '23 14:08 fernandoGitHub

Yes it should be possible, by using deterministic parameter value distributions.

See OpenSCENARIO User guide 9.3. Parameter value distribution file for introduction.

See esmini User guide - Parameter distributions for info on how to apply in esmini.

Here's a parameter value file example: cut-in_parameter_set.xosc

Let us know whether this is applicable for your use case or not.

eknabevcc avatar Sep 27 '23 06:09 eknabevcc

Thanks a lot Emil!

It is working perfectly!

F.F.

On Wed, Sep 27, 2023 at 9:00 AM Emil Knabe @.***> wrote:

Yes it should be possible, by using deterministic parameter value distributions.

See OpenSCENARIO User guide 9.3. Parameter value distribution file https://www.asam.net/index.php?eID=dumpFile&t=f&f=4908&token=ae9d9b44ab9257e817072a653b5d5e98ee0babf8#_parameter_value_distribution_file for introduction.

See esmini User guide - Parameter distributions https://esmini.github.io/#_parameter_distributions for info on how to apply in esmini.

Here's a parameter value file example: cut-in_parameter_set.xosc https://github.com/esmini/esmini/blob/master/resources/xosc/cut-in_parameter_set.xosc

Let us know whether this is applicable for your use case or not.

— Reply to this email directly, view it on GitHub https://github.com/esmini/esmini/issues/468#issuecomment-1736753035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZLDPE4RNGRUXJKSNQWXN3X4O6ITANCNFSM6AAAAAA4BPLWLM . You are receiving this because you authored the thread.Message ID: @.***>

fernandoGitHub avatar Sep 27 '23 08:09 fernandoGitHub