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.mixtures/agent.ml.html
Source file agent.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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
(******************************************************************************) (* _ __ * 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 *) (******************************************************************************) type t = int * int (** agent_id * agent_type *) type ag = t let make ~id ~sort = id, sort let print ?sigs ~with_id f (i, ty) = match sigs with | Some sigs -> Format.fprintf f "%a%t" (Signature.print_agent sigs) ty (fun f -> if with_id then Format.fprintf f "/*%i*/" i) | None -> Format.fprintf f "n%i" i let print_site ?sigs (i, agent) f id = match sigs with | Some sigs -> Signature.print_site sigs agent f id | None -> Format.fprintf f "n%is%i" i id let print_internal ?sigs (i, agent) site f id = match sigs with | Some sigs -> Signature.print_site_internal_state sigs agent site f (Some id) | None -> Format.fprintf f "n%is%i~%i" i site id let print_raw_internal ?sigs (i, agent) site f id = match sigs with | Some sigs -> Signature.print_internal_state sigs agent site f id | None -> Format.fprintf f "n%is%i~%i" i site id let rename ~debug_mode inj (n_id, n_ty) = Renaming.apply ~debug_mode inj n_id, n_ty let sort (_, ty) = ty let id (id, _) = id let compare (id1, _) (id2, _) = Mods.int_compare id1 id2 let json_dictionnary = "\"agent\":{\"id\":0,\"type\":1}" let write_json ob a = JsonUtil.write_compact_pair Yojson.Basic.write_int Yojson.Basic.write_int ob a let read_json p lb = JsonUtil.read_compact_pair Yojson.Basic.read_int Yojson.Basic.read_int p lb let to_json (id, ty) = `List [ `Int id; `Int ty ] let of_json = function | `List [ `Int id; `Int ty ] -> id, ty | x -> raise (Yojson.Basic.Util.Type_error ("Invalid agent", x)) module SetMap = SetMap.Make (struct type t = ag let compare = compare let print = print ?sigs:None ~with_id:true end)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>