{-# LANGUAGE DeriveGeneric, DeriveDataTypeable #-}
module Simulation.Aivika.Distributed.Optimistic.State
(LogicalProcessState(..),
TimeServerState(..)) where
import GHC.Generics
import Data.Typeable
import Data.Binary
import qualified Control.Distributed.Process as DP
import Control.Distributed.Process.Serializable
data LogicalProcessState =
LogicalProcessState { lpStateId :: DP.ProcessId,
lpStateName :: String,
lpStateStartTime :: Double,
lpStateStopTime :: Double,
lpStateLocalTime :: Double,
lpStateEventQueueTime :: Double,
lpStateEventQueueSize :: Int,
lpStateLogSize :: Int,
lpStateInputMessageCount :: Int,
lpStateOutputMessageCount :: Int,
lpStateTransientMessageCount :: Int,
lpStateRollbackCount :: Int
} deriving (Eq, Show, Typeable, Generic)
instance Binary LogicalProcessState
data TimeServerState =
TimeServerState { tsStateId :: DP.ProcessId,
tsStateName :: String,
tsStateGlobalVirtualTime :: Maybe Double,
tsStateLogicalProcesses :: [DP.ProcessId]
} deriving (Eq, Show, Typeable, Generic)
instance Binary TimeServerState