Class ToMarginal
-
- All Implemented Interfaces:
-
java.io.Serializable
public class ToMarginal implements Serializable
-
-
Constructor Summary
Constructors Constructor Description ToMarginal()
-
Method Summary
Modifier and Type Method Description static State.StateMarginalStatisticstoMarginal(NetworkStruct sn, int ind, Matrix state_i, Matrix phasesz, Matrix phaseshift, Matrix space_buf, Matrix space_srv, Matrix space_var)Computes marginal statistics for a stateful node in a Stochastic Petri Net. static State.StateMarginalStatisticstoMarginalAggr(NetworkStruct sn, int ind, Matrix state_i, Matrix K, Matrix Ks, Matrix space_buf, Matrix space_srv, Matrix space_var)Computes aggregated marginal statistics for a stateful node using specified aggregation weights. -
-
Method Detail
-
toMarginal
static State.StateMarginalStatistics toMarginal(NetworkStruct sn, int ind, Matrix state_i, Matrix phasesz, Matrix phaseshift, Matrix space_buf, Matrix space_srv, Matrix space_var)
Computes marginal statistics for a stateful node in a Stochastic Petri Net. This method extracts marginal statistics from the global state space, focusing on a specific node and computing its local state information including job populations, server allocations, and phase distributions. It handles different node types (transitions, places, caches) and their specific state representations.
For transition nodes with multi-phase service, it computes the distribution of jobs across different service phases. For station nodes, it aggregates queue lengths and server utilizations. The method is essential for event processing in SPN models where local node state must be extracted from the global state space.
- Parameters:
sn- Network structure containing the complete SPN model definitionind- Index of the node for which marginal statistics are computedstate_i- Current state vector for this node from the global state spacephasesz- Number of phases for each service mode (for transition nodes)phaseshift- Cumulative phase counts for indexing (for transition nodes)space_buf- Buffer space matrix containing queue state definitionsspace_srv- Server space matrix containing server allocation statesspace_var- Variable space matrix containing phase variable definitions- Returns:
StateMarginalStatistics containing:
- ni: Total number of jobs at the node
- nir: Number of jobs per class
- sir: Number of jobs in service per class
- kir: Per-phase job distribution for each class
-
toMarginalAggr
static State.StateMarginalStatistics toMarginalAggr(NetworkStruct sn, int ind, Matrix state_i, Matrix K, Matrix Ks, Matrix space_buf, Matrix space_srv, Matrix space_var)
Computes aggregated marginal statistics for a stateful node using specified aggregation weights. This method is a specialized variant of toMarginal that applies aggregation weights to compute weighted marginal statistics. It is particularly useful in event processing where multiple state configurations need to be combined with specific probabilities or weights, such as during transition enabling calculations or place token aggregation.
The aggregation weights K and Ks determine how different components of the state space are combined to produce the final marginal statistics. This is essential for handling complex state dependencies in SPN models where the effective state at a node depends on weighted contributions from multiple sources.
- Parameters:
sn- Network structure containing the complete SPN model definitionind- Index of the node for which aggregated marginal statistics are computedstate_i- Current state vector for this node from the global state spaceK- Aggregation weight matrix for combining state componentsKs- Cumulative aggregation weights for proper normalizationspace_buf- Buffer space matrix containing queue state definitionsspace_srv- Server space matrix containing server allocation statesspace_var- Variable space matrix containing phase variable definitions- Returns:
StateMarginalStatistics containing weighted/aggregated:
- ni: Total weighted number of jobs at the node
- nir: Weighted number of jobs per class
- sir: Weighted number of jobs in service per class
- kir: Weighted per-phase job distribution for each class
-
-
-
-