chemistrylab.util package
chemistrylab.util.Visualization module
- class chemistrylab.util.Visualization.matplotVisualizer(char_bench)[source]
Bases:
object
- legend_update_delay = 1
- class chemistrylab.util.Visualization.pygameVisualizer(char_bench)[source]
Bases:
object
Class to visualize the chemistry benches.
The dictionary viz gives a list of observations the class can visualize. These should correspond to observations which come from the characterization bench.
Call get_rgb(vessels) to get an rgb image of your vessel observations (which visualize all observations set in the characterization bench)
The resultant image is tiled such that every row has one type of observation, and every column contains all observations for a single vessel.
- get_rgb(vessels: Tuple[Vessel])[source]
Create an rgb image corresponding to the observations of each vessel.
- render_PVT(vessel: Vessel, x: int, y: int)[source]
Method to create a bar graph of the pressure,volume, and temperature of a vessel
- render_layers(vessel: Vessel, x: int, y: int)[source]
Method to visualize the layer information of a vessel.
chemistrylab.util.reward module
This module provides a default set of reward functions.
- class chemistrylab.util.reward.RewardGenerator(use_purity, exclude_solvents, include_dissolved, exclude_mat=None)[source]
Bases:
object
RewardGenerator class generates rewards for a given set of vessels and desired materials.
- Parameters:
use_purity (bool) – True if reward is based on purity, False if reward is based on the amount of desired material.
exclude_solvents (bool) – True if solvents should be excluded from the total amount of materials for purity calculations.
include_dissolved (bool) – True if reward should include dissolved material components in the vessels as the desired material.
exclude_mat (str, optional) – A string representing a material which gives a negative reward.
This class returns callable objects, which serve as reward functions