package kappa-library
Public internals of the Kappa tool suite. Use this package to use kappa as a lib
Install
Dune Dependency
Authors
Maintainers
Sources
v4.1.3.tar.gz
md5=1c9a8a0d79f085757817f90834e166f5
sha512=13ac40442940ba6e72d7dc5bf952e67443872f7bff63e9c76a3a699a6904c88696047fe04519b7ec6546371642f6ee7b0983117be302694aca15500b0df40de3
doc/src/kappa-library.runtime/fluxmap.ml.html
Source file fluxmap.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
(******************************************************************************) (* _ __ * The Kappa Language *) (* | |/ / * Copyright 2010-2020 CNRS - Harvard Medical School - INRIA - IRIF *) (* | ' / *********************************************************************) (* | . \ * This file is distributed under the terms of the *) (* |_|\_\ * GNU Lesser General Public License Version 3 *) (******************************************************************************) let create_flux env counter din_kind = let size = Model.nb_syntactic_rules env + 1 in { Data.din_kind; Data.din_start = Counter.current_time counter; Data.din_hits = Array.make size 0; Data.din_fluxs = Array.make_matrix size size 0.; } let incr_flux_flux of_rule on_rule v flux = flux.Data.din_fluxs.(of_rule).(on_rule) <- flux.Data.din_fluxs.(of_rule).(on_rule) +. v let incr_flux_hit of_rule flux = flux.Data.din_hits.(of_rule) <- succ flux.Data.din_hits.(of_rule) let stop_flux env counter din_data = let size = Model.nb_syntactic_rules env + 1 in let din_rules = Array.init size (fun x -> Format.asprintf "%a" (Model.print_ast_rule ~noCounters:false ~env) x) in let () = match din_data.Data.din_kind with | Primitives.ABSOLUTE -> () | Primitives.RELATIVE | Primitives.PROBABILITY -> Array.iteri (fun i -> Array.iteri (fun j x -> din_data.Data.din_fluxs.(i).(j) <- (if din_data.Data.din_hits.(i) = 0 then x else x /. float_of_int din_data.Data.din_hits.(i)))) din_data.Data.din_fluxs in { Data.din_rules; Data.din_data; Data.din_end = Counter.current_time counter }
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>