Package nl.tno.imb.mc

Class ModelParameters

java.lang.Object
nl.tno.imb.mc.ModelParameters
All Implemented Interfaces:
SelfWrapper

public class ModelParameters
extends Object
implements SelfWrapper
Container for a list of model parameters.
For now this object is immutable.

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version Oct 17, 2016
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Details

  • Method Details

    • getParameterByName

      public Parameter getParameterByName​(String name)
      Retrieve the parameter with a specified name
      Parameters:
      name - String; name of the parameter to look up
      Returns:
      Parameter; the parameter with the specified name, or null if no parameter with the specified name exists in this ModelParameters object
    • getParameterNames

      public List<String> getParameterNames()
      Retrieve the names of all stored parameters. The returned object is a deep copy and may be modified by the caller.
      Returns:
      List<String>; the names of all stored parameters
    • parameterExists

      public boolean parameterExists​(String name)
      Report if this ModelParameters object contains a parameter with the specified name.
      Parameters:
      name - String; name of the parameter
      Returns:
      boolean; true if such a parameter exists; false if such a parameter does not exist
    • getParameterType

      public Parameter.ParameterType getParameterType​(String name) throws IMBException
      Retrieve the type of a parameter.
      Parameters:
      name - String; name of the parameter
      Returns:
      Parameter.ParameterType; the type of the parameter
      Throws:
      IMBException - when no parameter with the specified name exists in this ModelParameters object
    • getParameterValue

      public Object getParameterValue​(String name) throws IMBException
      Retrieve the value of a parameter.
      Parameters:
      name - String; name of the parameter
      Returns:
      Object; the value of the parameter
      Throws:
      IMBException - when no parameter with the specified name exists in this ModelParameters object
    • addParameter

      public boolean addParameter​(Parameter parameter)
      Add a parameter. The name of the parameter must be unique.
      Parameters:
      parameter - Parameter; Parameter
      Returns:
      boolean; true if the parameter was added
    • prepare

      public void prepare​(TByteBuffer payload)
      Perform the prepare operation.
      Specified by:
      prepare in interface SelfWrapper
      Parameters:
      payload - TByteBuffer; the buffer to prepare for reception of the object that implements this interface
    • qWrite

      public void qWrite​(TByteBuffer payload)
      Perform the qWrite operation.
      Specified by:
      qWrite in interface SelfWrapper
      Parameters:
      payload - TByteBuffer; the buffer on which to apply the qWrite operation
    • toString

      public String toString()
      Overrides:
      toString in class Object