JaCaMo team for MAPC 2020
Requirements:
/clientconf/createFile.sh
, setting on both teams the host
parameter to localhost
, password
to 1
, and set the parameter username
to agentA%d
and agentB%d
on team A and B respectivelly. Server.main(...)
at the file src/java/runMAPC2020/Control.java
../gradlew run
, press enter to start the simulation, and see the execution on a browser. You can set another strategy giving arguments, for instance: ./gradlew run --args="src/jcm/individualist.jcm
/clientconf/createFile.sh
, setting on both teams configuration the host
, password
, and username
that will be used for the competition (e.g.: agentcontest1.in.tu-clausthal.de
, some-password
, agentJaCaMo_Builders%d
). In this case, you can set teamA to play on a server (e.g. agentcontest1.in.tu-clausthal.de
) and team B to play on a second server (e.g. agentcontest2.in.tu-clausthal.de
). Server.main(...)
at the file src/java/runMAPC2020/Control.java
../gradlew run --args="src/jcm/teamA.jcm
or ./gradlew run --args="src/jcm/teamB.jcm
according to the server.Requirements:
To add the project in your workspace, use the Eclipse menu File|Import|Existing Gradle Project
and select the project directory.
Then
runMAPC2020.Run
Requirements:
Run once (sudo - root privileges can be necessary):
docker volume create --name gradle-cache
Run the team (sudo - root privileges can be necessary):
docker run -ti --rm -u gradle -v gradle-cache:/home/gradle/.gradle -v "$PWD":/home/gradle/project -w /home/gradle/project -p 8000:8000 gradle:6.3.0-jdk13 ./gradlew run
--args=
after ./gradlew run
.
./gradlew run --args="src/jcm/donothing_X_donothing.jcm
../gradlew run --args="src/jcm/donothing_X_donothing.jcm browser
to open it. Use something else to do not open the browser ./gradlew run --args="src/jcm/donothing_X_donothing.jcm noBrowser
)../logging.properties
file to use handlers=java.util.logging.ConsoleHandler
and make sure no debug windows are activated in the .jcm
file..jcm
the visual interface for local position system is off (0
), which is the second parameter of localPositionSystem.lps(_,0)
.mapc2020/
src/
agt/ -- Jason Agents
buildblock/ -- mid-level plans for assembling complex structures
environment/ -- low-level bridges to artifacts
exploration/ -- low-level helpers for gps facilities
simulation/ -- low-level bridges for interacting with massim
strategies/ -- top-level strategies
tasks/ -- mid-level helpers for task accomplishment
walking/ -- low-level helpers for walking
agentBase.asl -- the base for top-level strategies
env/ -- CArtAgO Artifacts
connection/ -- artifacts to connect agents and the simulator
coordination/ -- artifacts to coordinate agents
localPositionSystem/ -- artifacts to provide gps facilities
java/ -- Java supportive classes
bb/ -- can be used to store beliefs of agents for tests
jason/stdlib/ -- internal actions for mapc
mabOptimizer/ -- libs for Multi Armed Bandit stochastic algorithm
runMAPPC2020/ -- classes for launching the simulator and JaCaMo
scenario/ -- classes for scenario interpretations
jcm/ -- initialization scripts
test/
jacamo/ -- tests for jacamo systems
agt/ -- mapc tester agents folder
inc/ -- test helpers for mapc tester agents
1
point and a 2 blocks task gives 4
points.goal
areas, dispensers
and taskboards
are walkable, but obstacles
or terrains occupied by agents/entities
or blocks
are not.dropped block
to attach it, or it can go to an adjacent position of a specific dispenser
to request and attach it.src/agt/simulation
provides libraries to deal with the end of a round in order to clean agents' mids and artifacts.a
and b
). In most of our tests we are developing the team a
and running against b
composed by do_nothing
agents, i.e., these agents just skip
their actions every step.agent
, followed by the team identification (A
or B
) and an unique number for each team starting from the number 1 (e.g.: agentA1, agentA2,... and, agentB1, agentB2,...)src/jcm/weak_individualistg.jcm
and src/agt/strategies/weak_individualist.asl
as model, duplicating these file and changing the copy for your own purposes. This model agent already uses src/agt/agentBase.asl
which provides exploration facilities, i.e., an empty new strategy (just including the agentBase.asl
code) is already supposed to work well, but just doing the exploration.+task(T,D,R,REQs)
in order to define actions that your strategy will perform when the simulator announces a task.asl
files instead of jcm
. To create new artifacts you may find interesting using the same model we have in src/agt/environment
files. For instance, artifact_eis.asl
shows how to create one artifact for each existing agent and artifact_gps.asl
shows how to create a shared artifact.mapc2020/serverconf/
and client setups, which are the most important part for us, are stated at mapc2020/clientconf/
folder.json
configuration files on mapc2020/clientconf/
are set to connect to the localhost
machine. When qualifying or during matches we will need to set our agents to some given server.
** The script createFiles.sh
helps to quickly create a set of configuration files, just edit the template inside of createFiles.sh
and run it $ ./createFiles.sh
.src/test/jason/asl
folder (all agents in this folder are automatically launched in the test task).{ include("$jasonJar/test/jason/inc/tester_agent.asl") }
src/test/jason/asl/test_meeting.asl
) support to the agent it is going to test:
{ include("exploration/meeting.asl") }
[test]
are automatically launched (e.g.: @test_coord_same_position[test]
)./gradlew test
to check results. You can run ./gradlew test -i
to see more detailed messages or event ./gradlew test --debug
for a full debugFor instance, let us say tat @test_coord_same_position
is as below:
@test_coord_same_position[test]
+!test_coord_same_position
<-
?coord(0,0,0,0,[],L1);
!assert_equals(61,.length(L1));
.findall(p(X,Y),proof(X,Y),L0);
.difference(L0,L1,DIFF);
!assert_equals([],DIFF);
.
In the file src/test/jason/asl/test_meeting.asl
we add some known facts. When running ./gradlew test
, it will launch this [test]
plan and get from a rule coord/6
which is provided by exploration/meeting.asl
a list L1
. From the known facts, we know that two perspectives from the same origin (0,0) have same view, so, they are sharing 61 elements, so we can assert it as done in !assert_equals(61,.length(L1));
. Then since we previously know each coordinate they are sharing (which regards to vision(5), i.e., 5 squares in radius) we have also created proof facts that are being confronted with the result provided by coord/6
. The difference from the proof and the result from coord/6
must be an empty set! In this sense, we are testing in this plan the rule coord/6
in the hypothetical case of two agents sharing the same position (0,0).
Tests are run every git push and can also be performed locally using ./gradlew test
or gradle test
.
We have a JCM using jacamo-web which may be helpful for faster the development of new features and tests. Actually, since MAPC uses a simulator which can produce changes very fast, jacamo-web is not being shown a good development environment. For this reason, the playground proposes the use jacamo-web out of the simulation. It is useful since it allows to quickly make changes (even while running) and after it has some maturity we can move from player's code to a final agent code or a tester agent. The script src/jcm/playground.jcm
just launches a jacamo-web environment with the agent src/agt/player.asl
. For instance, if we want to test the rule get_rotation
provided by walking/rotate_jA_star.asl
.
{ include("test_walking_helpers.asl") }
{ include("walking/rotate_jA_star.asl") }
+!start
<-
-+myposition(0,0);
-+origin(mymap);
?get_rotation(b(1,0,b0),b(0,1,b0),D0);
.log(warning,"Rotate a block from 3 o'clock to 6 o'clock got ",D0);
.
!start
whenever we want to check the result.player
with the new code to quickly try different possibilities.src/test/inc/test_walking.bb
.src/test/inc/test_walking_helpers.asl
has some examples of mocks at plan !add_test_plans_do(MIN_I)
).WARNING: