Class IoMapper

  • All Implemented Interfaces:
    java.io.Serializable

    public class IoMapper
    extends java.lang.Object
    implements java.io.Serializable
    Class for handling simulation inputs and outputs.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IoMapper.IoType
      Represents the type of input/output mapping.
    • Constructor Summary

      Constructors 
      Constructor Description
      IoMapper()
      Default constructor for IoMapper.
      IoMapper​(IoMapper other)
      Copy constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFrom()
      Retrieves the "from" field of this IoMapper.
      java.lang.String getFromExp()
      Gets the expression for the 'from' field.
      java.lang.String getFromList()
      Retrieves the "fromList" field of this IoMapper.
      java.lang.Object getOutputResult​(org.simulator.math.odes.MultiTable results, double leadTime)
      Retrieves the numeric result for this IoMapper from simulation output.
      PreGenerator getPreGenerator()
      Gets the pre-generator instance.
      java.lang.String getTo()
      Retrieves the "to" field of this IoMapper.
      IoMapper.IoType getType()
      Retrieves the type of this IoMapper.
      double getVariance()
      Gets the variance threshold.
      org.mitre.synthea.world.concepts.VitalSign getVitalSignTarget()
      Retrieves the VitalSign corresponding to this IoMapper's "to" field.
      void initialize()
      Initializes the expression processor if needed with all inputs set as the default type (Decimal).
      void initialize​(java.util.Map<java.lang.String,​java.lang.String> paramTypes)
      Initializes the expression processor for each thread if needed.
      void setFrom​(java.lang.String from)
      Sets the "from" field of this IoMapper.
      void setFromExp​(java.lang.String fromExp)
      Sets the expression for the 'from' field.
      void setFromList​(java.lang.String fromList)
      Sets the "fromList" field of this IoMapper.
      void setPreGenerator​(PreGenerator preGenerator)
      Sets the pre-generator instance.
      void setTo​(java.lang.String to)
      Sets the "to" field of this IoMapper.
      void setType​(IoMapper.IoType type)
      Sets the type of this IoMapper.
      void setVariance​(double varianceThreshold)
      Sets the variance threshold.
      double toModelInputs​(Person person, long time, java.util.Map<java.lang.String,​java.lang.Double> modelInputs)
      Populates model input parameters from the given person object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IoMapper

        public IoMapper()
        Default constructor for IoMapper.
      • IoMapper

        public IoMapper​(IoMapper other)
        Copy constructor.
        Parameters:
        other - other IoMapper instance
    • Method Detail

      • getType

        public IoMapper.IoType getType()
        Retrieves the type of this IoMapper.
        Returns:
        The IoType of this IoMapper.
      • setType

        public void setType​(IoMapper.IoType type)
        Sets the type of this IoMapper.
        Parameters:
        type - The IoType to set.
      • getFrom

        public java.lang.String getFrom()
        Retrieves the "from" field of this IoMapper.
        Returns:
        The "from" field value.
      • setFrom

        public void setFrom​(java.lang.String from)
        Sets the "from" field of this IoMapper.
        Parameters:
        from - The "from" field value to set.
      • getTo

        public java.lang.String getTo()
        Retrieves the "to" field of this IoMapper.
        Returns:
        The "to" field value.
      • setTo

        public void setTo​(java.lang.String to)
        Sets the "to" field of this IoMapper.
        Parameters:
        to - The "to" field value to set.
      • getFromList

        public java.lang.String getFromList()
        Retrieves the "fromList" field of this IoMapper.
        Returns:
        The "fromList" field value.
      • setFromList

        public void setFromList​(java.lang.String fromList)
        Sets the "fromList" field of this IoMapper.
        Parameters:
        fromList - The "fromList" field value to set.
      • getFromExp

        public java.lang.String getFromExp()
        Gets the expression for the 'from' field.
        Returns:
        The 'from' expression.
      • setFromExp

        public void setFromExp​(java.lang.String fromExp)
        Sets the expression for the 'from' field.
        Parameters:
        fromExp - The 'from' expression to set.
      • getVariance

        public double getVariance()
        Gets the variance threshold.
        Returns:
        The variance threshold.
      • setVariance

        public void setVariance​(double varianceThreshold)
        Sets the variance threshold.
        Parameters:
        varianceThreshold - The variance threshold to set.
      • getPreGenerator

        public PreGenerator getPreGenerator()
        Gets the pre-generator instance.
        Returns:
        The pre-generator instance.
      • setPreGenerator

        public void setPreGenerator​(PreGenerator preGenerator)
        Sets the pre-generator instance.
        Parameters:
        preGenerator - The pre-generator instance to set.
      • getVitalSignTarget

        public org.mitre.synthea.world.concepts.VitalSign getVitalSignTarget()
        Retrieves the VitalSign corresponding to this IoMapper's "to" field.
        Returns:
        target VitalSign Enum
      • initialize

        public void initialize()
        Initializes the expression processor if needed with all inputs set as the default type (Decimal).
      • initialize

        public void initialize​(java.util.Map<java.lang.String,​java.lang.String> paramTypes)
        Initializes the expression processor for each thread if needed.
        Parameters:
        paramTypes - map of parameters to their CQL types
      • toModelInputs

        public double toModelInputs​(Person person,
                                    long time,
                                    java.util.Map<java.lang.String,​java.lang.Double> modelInputs)
        Populates model input parameters from the given person object.
        Parameters:
        person - Person instance to get parameter values from
        time - Synthea simulation time
        modelInputs - map of input parameters to be populated
        Returns:
        double value of the mapped parameter
      • getOutputResult

        public java.lang.Object getOutputResult​(org.simulator.math.odes.MultiTable results,
                                                double leadTime)
        Retrieves the numeric result for this IoMapper from simulation output.
        Parameters:
        results - simulation results
        leadTime - lead time in seconds before using simulation values
        Returns:
        double value or List of Double values