Class ToMarginal

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ToMarginal()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • ToMarginal

        ToMarginal()
    • 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 definition
        ind - Index of the node for which marginal statistics are computed
        state_i - Current state vector for this node from the global state space
        phasesz - 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 definitions
        space_srv - Server space matrix containing server allocation states
        space_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 definition
        ind - Index of the node for which aggregated marginal statistics are computed
        state_i - Current state vector for this node from the global state space
        K - Aggregation weight matrix for combining state components
        Ks - Cumulative aggregation weights for proper normalization
        space_buf - Buffer space matrix containing queue state definitions
        space_srv - Server space matrix containing server allocation states
        space_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