DiscreteStepAnalyzer
DiscreteStepAnalyzer
Bases: StateAnalyzer
Implements simple utilities for analyzing simulation states which are specified by categorical occupancies for each site in the simulation
Source code in pylattica/discrete/discrete_step_analyzer.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
cell_count(state, phase_name)
Retrieves the number of cells in the given simulation state occupied by the specified phase.
Parameters
SimulationState
The state to analyze.
str
The name of the phase to count.
Returns
int The number of sites occupied by the specified phase.
Source code in pylattica/discrete/discrete_step_analyzer.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
cell_fraction(state, phase_name)
Returns the fraction of sites in the provided state which are occupied by the specified phase.
Parameters
SimulationState
The state to analyze.
str
The name of the phase for which a fraction of sites should be calculated
Returns
float The fraction of sites occupied by the specified phase.
Source code in pylattica/discrete/discrete_step_analyzer.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
cell_ratio(step, p1, p2)
Returns the occupancy ratio between two phases in the provided simulation state.
Parameters
SimulationState
The state to analyze.
str
The name of the first phase.
str
The name of the second phase
Returns
float The ratio of the occupancies of the two phases.
Source code in pylattica/discrete/discrete_step_analyzer.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
phase_count(step)
The number of phases present in the specified simulation state.
Parameters
SimulationState
The state to analyze.
Returns
int The number of phases identified.
Source code in pylattica/discrete/discrete_step_analyzer.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
phases_present(state)
Returns a list of the phases present in the specified state.
Parameters
SimulationState
The state to analyze.
Returns
List[str] A list of the phases identified.
Source code in pylattica/discrete/discrete_step_analyzer.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|