Commit c092421f authored by erwan's avatar erwan
Browse files

New: add in neighbor the pid of the process the neighbor is the a neighbor of

parent 21e43d9e
Pipeline #25706 passed with stages
in 9 minutes and 38 seconds
(* Time-stamp: <modified the 20/06/2019 (at 11:19) by Erwan Jahier> *)
(* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
open Sasacore
......@@ -9,6 +9,7 @@ type action = string (* just a label *)
type 's neighbor = {
state: 's ;
pid: unit -> string;
spid: unit -> string;
reply: unit -> int;
}
......@@ -33,7 +34,8 @@ let (to_reg_neigbor : 's Register.neighbor -> 's neighbor) =
fun n ->
{
state = n.Register.state ;
pid = n.Register.pid;
pid = n.Register.pid;
spid = n.Register.pid;
reply = n.Register.reply;
}
......
(* Time-stamp: <modified the 19/06/2019 (at 17:41) by Erwan Jahier> *)
(* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
(** Process programmer API *)
type 's neighbor = {
state: 's; (* processes local state (user defined) *)
pid : unit -> string; (* nb: this pid is not available in all
simulation modes (e.g., anonymous) *)
spid: unit -> string; (* pid of the process this neighbor is the neighbor of *)
reply: unit -> int;
(* Returns the channel number that let this neighbor access to the
content of the process, if it neighbor can access it. Returns -1
......
(* Time-stamp: <modified the 19/06/2019 (at 10:51) by Erwan Jahier> *)
(* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
type 's neighbor = {
state: 's ;
pid: unit -> string;
spid: unit -> string;
reply: unit -> int;
}
......
(* Time-stamp: <modified the 19/06/2019 (at 11:28) by Erwan Jahier> *)
(* Time-stamp: <modified the 21/06/2019 (at 15:05) by Erwan Jahier> *)
type 's neighbor = {
state: 's ;
pid: unit -> string;
spid: unit -> string;
reply: unit -> int;
}
......
(* Time-stamp: <modified the 20/06/2019 (at 16:12) by Erwan Jahier> *)
(* Time-stamp: <modified the 21/06/2019 (at 15:06) by Erwan Jahier> *)
open Register
open Sasacore
......@@ -34,6 +34,7 @@ let (get_neighors: Topology.t -> Topology.node_id -> 'v -> 'v Register.neighbor
(* XXX For the 2 fields above, check the graph kind (anonymous,
identified, etc. *)
pid = (fun () -> node.id);
spid = (fun () -> source_id);
reply = (fun () -> reply g source_id neighbor_id);
}
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment