diff --git a/Makefile b/Makefile index b52ae8a..5593be1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ all: ./rebar compile +deps: + ./rebar get-deps + ./rebar compile + clean: ./rebar clean diff --git a/README.txt b/README.txt index d6ed85e..96c0d1c 100644 --- a/README.txt +++ b/README.txt @@ -8,66 +8,31 @@ eXAT Release 1.3 "EYE" ====================== -1. Unpacking and Compiling eXAT +1. Compiling eXAT - "cd" to your local dir where you want to install eXAT and issue the -command: - - $ tar zxf - - A directory eXAT-1.2 will be created. Then issue the following commands - - $ cd eXAT-1.3 - $ gmake + $ make deps + $ make eXAT now will be compiled. - 2. Testing eXAT - You can test eXAT by using the "pingagent" and "pingeragent" provided in -the package (see sub-dir "src"). To this aim, use the following steps: - + You can test eXAT by using the "simple_pingagent" and + "simple_pingeragent" provided in examples/simple. Do the following + steps: a) Check that TCP ports 7779 and 7780 are not used in your PC; - b) From the "eXAT-1.3" directory, launch the "pingagent" by using the - following command (this will start the reponder agent): - - $ ./exat.sh platform1 -start pingagent - - The output will be as follows: - -(platform@csanto)1> - __ __ __ _______ - \ \ / / / \ |__ __| - ____ \ \ / / / /\ \ | | - / __ \ \ \/ / | |__| | | | - | ____/ / /\ \ | __ | | | - | \____ / / \ \ | | | | | | - \____/ /_/ \_\ |_| |_| |_| -***** ***************** -* The erlang eXperimental Agent Tool -- Release 1.3.0-EYE * -*********************************************************** -eXAT, an erlang eXperimental Agent Tool -ERESYE, an ERlang Expert SYstem Engine -Copyright (C) 2003-07 Corrado Santoro (csanto@diit.unict.it) -Copyright (C) 2005-07 Francesca Gangemi (francesca@erlang-consulting.com) -Copyright (C) 2011 Gleb Peregud (gleber.p@gmail.com) - -['HTTP-MTP'] MTP Started at port 7779 -['ONTOLOGY'] Started -['AMS'] Staring AMS. -['ONTOLOGY'] Registering Codec fipa_ontology_sl_codec for ontology FIPA-Agent-Management -['AMS'] Staring Applications: {pingagent} - - - c) From another shell, reach eXAT-1.3 dir and issue the following -command (this will start the ping initiator agent): - $ ./exat.sh plaftform2 -http_port 7780 -start pingeragent -destagent pingagent,http://localhost:7779/acc + b) $ cd examples/simple + $ make + + b) From one shell issue - Now you'll see, in both shells, the messages flowing from one agent to -the other one. + $ ./run_first.sh + + c) From another shell run: ---- END OF README -- + $ ./run_second.sh + Now you'll see, in simple_pingerpinger shell, that he can receive +messages from simple_pingagent. diff --git a/examples/Makefile b/examples/Makefile index 0309eb3..d1e65d0 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -2,11 +2,13 @@ # Makefile # +DIRS=$(shell echo */) all: - @(cd eresye;make) + for i in $(DIRS) ; do \ + (cd $$i; make) ; \ + done clean: + @(cd simple;make clean) @(cd eresye;make clean) - - diff --git a/examples/eresye/Makefile b/examples/eresye/Makefile index d756556..5defbf7 100644 --- a/examples/eresye/Makefile +++ b/examples/eresye/Makefile @@ -2,11 +2,7 @@ # Makefile # -EBIN=. - -include ../../Makefile.conf - -.SUFFIXES: .erl .beam +BEAM=erlc OBJS=\ auto.beam \ @@ -18,8 +14,6 @@ prodcons.beam \ sieve.beam - - ERL_OBJS=$(foreach file, $(OBJS), $(file)) OTHER_OBJS= @@ -38,4 +32,3 @@ clean: clearbak: @$(FIND) . -type f -name \*~ -exec rm {} \; - diff --git a/examples/jade/Makefile b/examples/jade/Makefile new file mode 100644 index 0000000..204d005 --- /dev/null +++ b/examples/jade/Makefile @@ -0,0 +1,2 @@ +all: + (cd ../../../; erlc -pa exat/ebin/ -I exat/include/ -I exat/src/ exat/examples/jade/exat_agent.erl) diff --git a/examples/jade/exat_agent.erl b/examples/jade/exat_agent.erl index b1462f4..70532c7 100755 --- a/examples/jade/exat_agent.erl +++ b/examples/jade/exat_agent.erl @@ -2,6 +2,7 @@ -export([extends/0]). -export([pattern/2,event/2,action/2,on_starting/1, do_request/4,start/0]). + -include_lib("exat/include/acl.hrl"). -include_lib("exat/include/fipa_ontology.hrl"). diff --git a/examples/original_exat/Makefile b/examples/original_exat/Makefile new file mode 100644 index 0000000..ddab5af --- /dev/null +++ b/examples/original_exat/Makefile @@ -0,0 +1,2 @@ +all + erlc -pa ../../ebin/ -I ../../include/ -I ../../src/ pingagent.erl pingeragent.erl diff --git a/examples/simple/simple_pingagent.erl b/examples/simple/simple_pingagent.erl index 64310aa..f178118 100644 --- a/examples/simple/simple_pingagent.erl +++ b/examples/simple/simple_pingagent.erl @@ -28,7 +28,9 @@ stop() -> % agents callback handle_acl(#aclmessage{speechact = 'QUERY-REF', + sender = Sender, content = "ping"} = Msg, State) -> + io:format("Got ping query from ~p: ~p~n~nInforming that I'm alive!~n~n", [Sender, Msg]), spawn(fun() -> acl:reply(Msg, 'INFORM', "alive") end), {noreply, State}; diff --git a/examples/simple/simple_pingeragent.erl b/examples/simple/simple_pingeragent.erl index 14d3782..6914c0c 100644 --- a/examples/simple/simple_pingeragent.erl +++ b/examples/simple/simple_pingeragent.erl @@ -28,7 +28,7 @@ stop() -> % agents callback handle_acl(#aclmessage{speechact = 'INFORM', content = "alive"} = Msg, {_, DestAgent} = State) -> - io:format("~p is alive!~n", [DestAgent]), + io:format("~p is alive, since I got: ~p~n~n", [DestAgent, Msg]), {noreply, State}; handle_acl(#aclmessage{} = Msg, State) -> @@ -39,7 +39,7 @@ handle_acl(#aclmessage{} = Msg, State) -> %% gen_server callbacks init(Name, [DestAgent]) -> - timer:send_interval(5000, ping), + timer:send_interval(500, ping), {ok, {Name, DestAgent}}. handle_call(Call, _From, State) -> diff --git a/rebar.config b/rebar.config index 9c25d18..feff4ec 100644 --- a/rebar.config +++ b/rebar.config @@ -1,5 +1,5 @@ {deps_dir, ["lib"]}. %% {sub_dirs, ["examples/simple"]}. -{erl_opts, [{src_dirs, ["examples/simple"]}]}. +%% {erl_opts, [{src_dirs, ["examples/simple"]}]}. {deps, [{misultin, "0.9-dev", {git, "https://github.com/gleber/misultin.git", "master"}}]}. diff --git a/src/exat.app.src b/src/exat.app.src index 0493fc3..e54ec8f 100644 --- a/src/exat.app.src +++ b/src/exat.app.src @@ -19,7 +19,7 @@ % {application, exat, [{ mod, { exat, [] } }, - { vsn, "1.2.0" }, + { vsn, "1.3.1" }, { applications, [kernel, stdlib] }, { description, "erlang eXperimental Agent Tool" }, { registered, [] }