Skip to content

Commit

Permalink
use 20s time intervals for praos sampling sims
Browse files Browse the repository at this point in the history
  • Loading branch information
Saizan committed Oct 31, 2024
1 parent cda8198 commit e5f1713
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions simulation/src/PraosProtocol/ExamplesPraosP2P.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ example1 =
]
]
where
model = praosSimVizModel $ example1Trace rng0 p2pTopography
model = praosSimVizModel $ example1Trace rng0 5 p2pTopography
p2pTopography = genArbitraryP2PTopography p2pTopographyCharacteristics rng0
p2pTopographyCharacteristics =
P2PTopographyCharacteristics
Expand Down Expand Up @@ -145,7 +145,7 @@ example1000Diffusion ::
IO ()
example1000Diffusion nlinks stop fp =
runSampleModel (diffusionSampleModel p2pTopographyCharacteristics fp) stop $
example1Trace rng p2pTopography
example1Trace rng 20 p2pTopography
where
rng = mkStdGen 42
p2pTopography = genArbitraryP2PTopography p2pTopographyCharacteristics rng
Expand All @@ -161,8 +161,8 @@ example1000Diffusion nlinks stop fp =
, p2pNodeLinksRandom = nlinks
}

example1Trace :: StdGen -> P2P.P2PTopography -> PraosTrace
example1Trace rng0 p2pTopography =
example1Trace :: StdGen -> DiffTime -> P2P.P2PTopography -> PraosTrace
example1Trace rng0 blockInterval p2pTopography =
tracePraosP2P
rng0
p2pTopography
Expand All @@ -174,7 +174,7 @@ example1Trace rng0 p2pTopography =
(kilobytes 96)
rng
-- average seconds between blocks:
(5 * fromIntegral p2pNumNodes)
(realToFrac blockInterval * fromIntegral p2pNumNodes)
, praosConfig =
PraosConfig
{ slotConfig
Expand Down
4 changes: 2 additions & 2 deletions simulation/src/SampleMain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ options =

simulations :: [(String, Sim)]
simulations =
[ ("praos-diffusion-5", (Time 20, VizPraosP2P.example1000Diffusion 5))
, ("praos-diffusion-10", (Time 20, VizPraosP2P.example1000Diffusion 10))
[ ("praos-diffusion-5", (Time 40, VizPraosP2P.example1000Diffusion 5))
, ("praos-diffusion-10", (Time 40, VizPraosP2P.example1000Diffusion 10))
]

readViz :: String -> Either String (String, Sim)
Expand Down

0 comments on commit e5f1713

Please sign in to comment.