Skip to content

Commit

Permalink
improve README, Makefiles for easier startup
Browse files Browse the repository at this point in the history
  • Loading branch information
gleber committed Feb 27, 2012
1 parent f419c60 commit e8bc01a
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 66 deletions.
4 changes: 4 additions & 0 deletions Makefile
@@ -1,6 +1,10 @@
all: all:
./rebar compile ./rebar compile


deps:
./rebar get-deps
./rebar compile

clean: clean:
./rebar clean ./rebar clean


Expand Down
67 changes: 16 additions & 51 deletions README.txt
Expand Up @@ -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 $ make deps
command: $ make

$ tar zxf <put the pathname of 'eXAT-1.3.tar.gz' here>

A directory eXAT-1.2 will be created. Then issue the following commands

$ cd eXAT-1.3
$ gmake


eXAT now will be compiled. eXAT now will be compiled.



2. Testing eXAT 2. Testing eXAT


You can test eXAT by using the "pingagent" and "pingeragent" provided in You can test eXAT by using the "simple_pingagent" and
the package (see sub-dir "src"). To this aim, use the following steps: "simple_pingeragent" provided in examples/simple. Do the following

steps:


a) Check that TCP ports 7779 and 7780 are not used in your PC; 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 $ ./run_first.sh
the other one.
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.
8 changes: 5 additions & 3 deletions examples/Makefile
Expand Up @@ -2,11 +2,13 @@
# Makefile # Makefile
# #


DIRS=$(shell echo */)


all: all:
@(cd eresye;make) for i in $(DIRS) ; do \
(cd $$i; make) ; \
done


clean: clean:
@(cd simple;make clean)
@(cd eresye;make clean) @(cd eresye;make clean)


9 changes: 1 addition & 8 deletions examples/eresye/Makefile
Expand Up @@ -2,11 +2,7 @@
# Makefile # Makefile
# #


EBIN=. BEAM=erlc

include ../../Makefile.conf

.SUFFIXES: .erl .beam


OBJS=\ OBJS=\
auto.beam \ auto.beam \
Expand All @@ -18,8 +14,6 @@ prodcons.beam \
sieve.beam sieve.beam






ERL_OBJS=$(foreach file, $(OBJS), $(file)) ERL_OBJS=$(foreach file, $(OBJS), $(file))


OTHER_OBJS= OTHER_OBJS=
Expand All @@ -38,4 +32,3 @@ clean:


clearbak: clearbak:
@$(FIND) . -type f -name \*~ -exec rm {} \; @$(FIND) . -type f -name \*~ -exec rm {} \;

2 changes: 2 additions & 0 deletions 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)
1 change: 1 addition & 0 deletions examples/jade/exat_agent.erl
Expand Up @@ -2,6 +2,7 @@
-export([extends/0]). -export([extends/0]).
-export([pattern/2,event/2,action/2,on_starting/1, -export([pattern/2,event/2,action/2,on_starting/1,
do_request/4,start/0]). do_request/4,start/0]).

-include_lib("exat/include/acl.hrl"). -include_lib("exat/include/acl.hrl").
-include_lib("exat/include/fipa_ontology.hrl"). -include_lib("exat/include/fipa_ontology.hrl").


Expand Down
2 changes: 2 additions & 0 deletions examples/original_exat/Makefile
@@ -0,0 +1,2 @@
all
erlc -pa ../../ebin/ -I ../../include/ -I ../../src/ pingagent.erl pingeragent.erl
2 changes: 2 additions & 0 deletions examples/simple/simple_pingagent.erl
Expand Up @@ -28,7 +28,9 @@ stop() ->
% agents callback % agents callback


handle_acl(#aclmessage{speechact = 'QUERY-REF', handle_acl(#aclmessage{speechact = 'QUERY-REF',
sender = Sender,
content = "ping"} = Msg, State) -> 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), spawn(fun() -> acl:reply(Msg, 'INFORM', "alive") end),
{noreply, State}; {noreply, State};


Expand Down
4 changes: 2 additions & 2 deletions examples/simple/simple_pingeragent.erl
Expand Up @@ -28,7 +28,7 @@ stop() ->
% agents callback % agents callback
handle_acl(#aclmessage{speechact = 'INFORM', handle_acl(#aclmessage{speechact = 'INFORM',
content = "alive"} = Msg, {_, DestAgent} = State) -> 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}; {noreply, State};


handle_acl(#aclmessage{} = Msg, State) -> handle_acl(#aclmessage{} = Msg, State) ->
Expand All @@ -39,7 +39,7 @@ handle_acl(#aclmessage{} = Msg, State) ->
%% gen_server callbacks %% gen_server callbacks


init(Name, [DestAgent]) -> init(Name, [DestAgent]) ->
timer:send_interval(5000, ping), timer:send_interval(500, ping),
{ok, {Name, DestAgent}}. {ok, {Name, DestAgent}}.


handle_call(Call, _From, State) -> handle_call(Call, _From, State) ->
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
@@ -1,5 +1,5 @@
{deps_dir, ["lib"]}. {deps_dir, ["lib"]}.
%% {sub_dirs, ["examples/simple"]}. %% {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"}}]}. {deps, [{misultin, "0.9-dev", {git, "https://github.com/gleber/misultin.git", "master"}}]}.


2 changes: 1 addition & 1 deletion src/exat.app.src
Expand Up @@ -19,7 +19,7 @@
% %
{application, exat, {application, exat,
[{ mod, { exat, [] } }, [{ mod, { exat, [] } },
{ vsn, "1.2.0" }, { vsn, "1.3.1" },
{ applications, [kernel, stdlib] }, { applications, [kernel, stdlib] },
{ description, "erlang eXperimental Agent Tool" }, { description, "erlang eXperimental Agent Tool" },
{ registered, [] } { registered, [] }
Expand Down

0 comments on commit e8bc01a

Please sign in to comment.