{-# 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 { LogicalProcessState -> ProcessId
lpStateId :: DP.ProcessId,
LogicalProcessState -> String
lpStateName :: String,
LogicalProcessState -> Double
lpStateStartTime :: Double,
LogicalProcessState -> Double
lpStateStopTime :: Double,
LogicalProcessState -> Double
lpStateLocalTime :: Double,
LogicalProcessState -> Double
lpStateEventQueueTime :: Double,
LogicalProcessState -> Int
lpStateEventQueueSize :: Int,
LogicalProcessState -> Int
lpStateLogSize :: Int,
LogicalProcessState -> Int
lpStateInputMessageCount :: Int,
LogicalProcessState -> Int
lpStateOutputMessageCount :: Int,
LogicalProcessState -> Int
lpStateTransientMessageCount :: Int,
LogicalProcessState -> Int
lpStateRollbackCount :: Int
} deriving (LogicalProcessState -> LogicalProcessState -> Bool
(LogicalProcessState -> LogicalProcessState -> Bool)
-> (LogicalProcessState -> LogicalProcessState -> Bool)
-> Eq LogicalProcessState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LogicalProcessState -> LogicalProcessState -> Bool
== :: LogicalProcessState -> LogicalProcessState -> Bool
$c/= :: LogicalProcessState -> LogicalProcessState -> Bool
/= :: LogicalProcessState -> LogicalProcessState -> Bool
Eq, Int -> LogicalProcessState -> ShowS
[LogicalProcessState] -> ShowS
LogicalProcessState -> String
(Int -> LogicalProcessState -> ShowS)
-> (LogicalProcessState -> String)
-> ([LogicalProcessState] -> ShowS)
-> Show LogicalProcessState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LogicalProcessState -> ShowS
showsPrec :: Int -> LogicalProcessState -> ShowS
$cshow :: LogicalProcessState -> String
show :: LogicalProcessState -> String
$cshowList :: [LogicalProcessState] -> ShowS
showList :: [LogicalProcessState] -> ShowS
Show, Typeable, (forall x. LogicalProcessState -> Rep LogicalProcessState x)
-> (forall x. Rep LogicalProcessState x -> LogicalProcessState)
-> Generic LogicalProcessState
forall x. Rep LogicalProcessState x -> LogicalProcessState
forall x. LogicalProcessState -> Rep LogicalProcessState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. LogicalProcessState -> Rep LogicalProcessState x
from :: forall x. LogicalProcessState -> Rep LogicalProcessState x
$cto :: forall x. Rep LogicalProcessState x -> LogicalProcessState
to :: forall x. Rep LogicalProcessState x -> LogicalProcessState
Generic)
instance Binary LogicalProcessState
data TimeServerState =
TimeServerState { TimeServerState -> ProcessId
tsStateId :: DP.ProcessId,
TimeServerState -> String
tsStateName :: String,
TimeServerState -> Maybe Double
tsStateGlobalVirtualTime :: Maybe Double,
TimeServerState -> [ProcessId]
tsStateLogicalProcesses :: [DP.ProcessId]
} deriving (TimeServerState -> TimeServerState -> Bool
(TimeServerState -> TimeServerState -> Bool)
-> (TimeServerState -> TimeServerState -> Bool)
-> Eq TimeServerState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimeServerState -> TimeServerState -> Bool
== :: TimeServerState -> TimeServerState -> Bool
$c/= :: TimeServerState -> TimeServerState -> Bool
/= :: TimeServerState -> TimeServerState -> Bool
Eq, Int -> TimeServerState -> ShowS
[TimeServerState] -> ShowS
TimeServerState -> String
(Int -> TimeServerState -> ShowS)
-> (TimeServerState -> String)
-> ([TimeServerState] -> ShowS)
-> Show TimeServerState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TimeServerState -> ShowS
showsPrec :: Int -> TimeServerState -> ShowS
$cshow :: TimeServerState -> String
show :: TimeServerState -> String
$cshowList :: [TimeServerState] -> ShowS
showList :: [TimeServerState] -> ShowS
Show, Typeable, (forall x. TimeServerState -> Rep TimeServerState x)
-> (forall x. Rep TimeServerState x -> TimeServerState)
-> Generic TimeServerState
forall x. Rep TimeServerState x -> TimeServerState
forall x. TimeServerState -> Rep TimeServerState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TimeServerState -> Rep TimeServerState x
from :: forall x. TimeServerState -> Rep TimeServerState x
$cto :: forall x. Rep TimeServerState x -> TimeServerState
to :: forall x. Rep TimeServerState x -> TimeServerState
Generic)
instance Binary TimeServerState