PolyProcessInterface / ppi

2 stars 2 forks source link

Infrastructure specific configuration #79

Closed n-peugnet closed 4 years ago

n-peugnet commented 4 years ago

This Pull request adds 2 changes:

Rename Scenario into Config

As the json file now contains more configuration than just the scenario I renamed the corresponding class into Config. Applies changes from https://github.com/PolyProcessInterface/ppi/pull/70#issuecomment-645630633

Infrastructure specific configuration

With these changes an infrastructure can easily read parameters specific to it. It can define its key under the "infra" json object by implementing the Runner.getName() function then it can read a property with the following function of Config:

public <T> T getInfraProp(String key, T defaultValue) throws ClassCastException

Here is a usage exemple: https://github.com/PolyProcessInterface/ppi/blob/144bcad141379d8a82437e11177dc98b23fe97ba/src/main/java/org/sar/ppi/peersim/PeerSimRunner.java#L35

Resolves #74