Module cre_master

A module implementing the behavior of the common runtime environment (CRE).

Copyright © 2015-2017 Jörgen Brandt

Version: 0.1.0

Behaviours: gen_pnet.

Authors: Jörgen Brandt (joergen.brandt@onlinehome.de).

Description

A module implementing the behavior of the common runtime environment (CRE).

Function Index

add_client/2Registers a client process with a given CRE instance.
add_worker/2Registers a worker process with a given CRE instance.
code_change/3
cre_request/4Requests the computation of an application from a given CRE intance.
fire/3
handle_call/3
handle_cast/2
handle_info/2
init/1
init_marking/2
is_enabled/3
place_lst/0
preset/1
start_link/0Starts an anonymous CRE instance.
start_link/1Starts a named CRE instance.
stop/1Stops the CRE instance.
terminate/2
trigger/3
trsn_lst/0
worker_result/4Sends the result of a previously computed application to the CRE.

Function Details

add_client/2

add_client(CreName, ClientName) -> any()

Registers a client process with a given CRE instance.

Takes the name of a CRE instance CreName and the name of a client instance ClientName and adds the client to the client pool of the CRE.

add_worker/2

add_worker(CreName, WorkerName) -> any()

Registers a worker process with a given CRE instance.

Takes the name of a CRE instance CreName and the name of a worker instance WorkerName and adds the worker to the worker pool of the CRE. The presence of workers is a precondition for the CRE to send out demand or perform work. A CRE without workers, thus, can accept clients but can never make progress.

code_change/3

code_change(OldVsn, NetState, Extra) -> any()

cre_request/4

cre_request(CreName, ClientName, I, A) -> any()

Requests the computation of an application from a given CRE intance.

When a client with the name ClientName that has received demand has generated an application A belonging to a program with the program identifier I it uses this function to send the application to the CRE instance with the name CreName.

fire/3

fire(X1, X2, X3) -> any()

handle_call/3

handle_call(Request, From, NetState) -> any()

handle_cast/2

handle_cast(Request, NetState) -> any()

handle_info/2

handle_info(Info, NetState) -> any()

init/1

init(MasterArg) -> any()

init_marking/2

init_marking(Place, UsrInfo) -> any()

is_enabled/3

is_enabled(Trsn, X2, X3) -> any()

place_lst/0

place_lst() -> any()

preset/1

preset(X1) -> any()

start_link/0

start_link() -> any()

Starts an anonymous CRE instance.

Returns {ok, Pid} on success where Pid is the process id of the newly created process.

See also: start_link/1.

start_link/1

start_link(CreName) -> any()

Starts a named CRE instance.

Returns {ok, Pid} on success where Pid is the process id of the newly created process.

See also: start_link/0.

stop/1

stop(CreName) -> any()

Stops the CRE instance.

terminate/2

terminate(Reason, NetState) -> any()

trigger/3

trigger(Place, Q, NetState) -> any()

trsn_lst/0

trsn_lst() -> any()

worker_result/4

worker_result(CreName, WorkerName, A, Delta) -> any()

Sends the result of a previously computed application to the CRE.

When a worker has computed the result of an application that has previously been requested from it the worker sends the result back to the CRE using this function.


Generated by EDoc