Package org.mitre.synthea.helpers
Class PhysiologyValueGenerator
- java.lang.Object
-
- org.mitre.synthea.helpers.ValueGenerator
-
- org.mitre.synthea.helpers.PhysiologyValueGenerator
-
- All Implemented Interfaces:
java.io.Serializable
public class PhysiologyValueGenerator extends ValueGenerator
A ValueGenerator for generation of values from a physiology simulation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.nio.file.Path
GENERATORS_PATH
-
Fields inherited from class org.mitre.synthea.helpers.ValueGenerator
person
-
-
Constructor Summary
Constructors Constructor Description PhysiologyValueGenerator(PhysiologyGeneratorConfig config, SimRunner runner, VitalSign vitalSign, Person person, double outputVariance)
A generator of VitalSign values from a physiology simulation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<PhysiologyValueGenerator>
fromConfig(java.io.File configFile, Person person)
Instantiates PhysiologyValueGenerators for each VitalSign output in the generator configuration at the provided path.static java.util.List<PhysiologyValueGenerator>
fromConfig(PhysiologyGeneratorConfig generatorConfig, Person person)
Instantiates PhysiologyValueGenerators for each VitalSign output in the generator configuration.static PhysiologyGeneratorConfig
getConfig(java.io.File configFile)
Retrieves the PhysiologyValueGenerator configuration from the given file.static PhysiologyGeneratorConfig
getConfig(java.lang.String configPath)
Retrieves the PhysiologyValueGenerator configuration from the given path.double
getValue(long time)
Get a value at a given point in time.VitalSign
getVitalSign()
Returns the VitalSign this generator targets.static java.util.List<PhysiologyValueGenerator>
loadAll(Person person)
Returns a List of all PhysiologyValueGenerators defined in the configuration directory.static java.util.List<PhysiologyValueGenerator>
loadAll(Person person, java.lang.String subfolder)
Loads all PhysiologyValueGenerators defined in the given generator configuration subdirectory.static void
setGeneratorsPath(java.nio.file.Path newPath)
void
setOutputVariance(double variance)
Sets the amount of variance to generate for the output VitalSign.java.lang.String
toString()
-
-
-
Constructor Detail
-
PhysiologyValueGenerator
public PhysiologyValueGenerator(PhysiologyGeneratorConfig config, SimRunner runner, VitalSign vitalSign, Person person, double outputVariance)
A generator of VitalSign values from a physiology simulation.- Parameters:
config
- physiology configuration fileperson
- Person instance to generate VitalSigns for
-
-
Method Detail
-
setGeneratorsPath
public static void setGeneratorsPath(java.nio.file.Path newPath)
-
loadAll
public static java.util.List<PhysiologyValueGenerator> loadAll(Person person)
Returns a List of all PhysiologyValueGenerators defined in the configuration directory.- Returns:
- List of PhysiologyValueGenerator
-
loadAll
public static java.util.List<PhysiologyValueGenerator> loadAll(Person person, java.lang.String subfolder)
Loads all PhysiologyValueGenerators defined in the given generator configuration subdirectory.- Parameters:
person
- Person to generate values forsubfolder
- generator sub directory to load configurations from- Returns:
- List of PhysiologyValueGenerator
-
fromConfig
public static java.util.List<PhysiologyValueGenerator> fromConfig(java.io.File configFile, Person person)
Instantiates PhysiologyValueGenerators for each VitalSign output in the generator configuration at the provided path.- Parameters:
configFile
- generator configuration fileperson
- Person to generate VitalSigns for- Returns:
- List of PhysiologyValueGenerator instances
-
fromConfig
public static java.util.List<PhysiologyValueGenerator> fromConfig(PhysiologyGeneratorConfig generatorConfig, Person person)
Instantiates PhysiologyValueGenerators for each VitalSign output in the generator configuration.- Parameters:
generatorConfig
- generator configuration objectperson
- Person to generate VitalSigns for- Returns:
- List of PhysiologyValueGenerator instances
-
getConfig
public static PhysiologyGeneratorConfig getConfig(java.lang.String configPath)
Retrieves the PhysiologyValueGenerator configuration from the given path.- Parameters:
configPath
- path to the generator configuration file- Returns:
- generator configuration object
-
getConfig
public static PhysiologyGeneratorConfig getConfig(java.io.File configFile)
Retrieves the PhysiologyValueGenerator configuration from the given file.- Parameters:
configFile
- generator configuration file- Returns:
- generator configuration object
-
getVitalSign
public VitalSign getVitalSign()
Returns the VitalSign this generator targets.- Returns:
- VitalSign target
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getValue
public double getValue(long time)
Description copied from class:ValueGenerator
Get a value at a given point in time.- Specified by:
getValue
in classValueGenerator
- Parameters:
time
- the time, needs to be current or in the future.- Returns:
- a numerical value
-
setOutputVariance
public void setOutputVariance(double variance)
Sets the amount of variance to generate for the output VitalSign.- Parameters:
variance
- amount of variance
-
-