First attempt at a matlab link.
[progcomp10.git] / src / link / MATLAB / ml_agent_template.m
1 #
2 # your-agent-name-here.m
3 # Your Name Here
4 #
5 # Created by Daniel Axtens on 28/07/10.
6 # Licensed under an MIT-style license: see the LICENSE file for details.
7 #
8
9 # import various constants and utilities
10 source( "link/MATLAB/matlab-consts.m" )
11
12 # defence = Defend( foeName , foePromisedAttack );
13
14 # foeName: string - the name of your foe;
15 # foePromisedAttack : string - the item your foe promised to use
16 # defence: string - the item you wish to use to defend;
17 #
18 # Called when your agent needs to defend itself.
19
20 function defence = Defend( foeName, foePromisedAttack ) 
21
22         defence = foePromisedAttack;
23
24 endfunction
25
26
27 # [attack, bluff] = Attack( foeName )
28 #
29 # foeName: string - the name of your foe
30 # attack: string - the actual attack you want to use
31 # bluff: string - the bluff attack that you say you will use.
32 #
33 # Called when your agent needs to attack another agent.
34
35
36 function [attack, bluff] = Attack( foeName )
37
38         attack = RandomAttack();
39         bluff = attack;
40
41 endfunction
42
43 # Results( foeName, isInstigatedByYou, winner, attItem, defItem, bluffItem,
44 #          pointDelta )
45 #
46 # foeName: string - the name of your foe;
47 # isInstigatedByYou : 0=you defended/1=you attacked;
48 # winner : RESULTTYPE - who won
49 # attItem : ITEMTYPE - the item used to attack;
50 # defItem : ITEMTYPE - the item used to defend;
51 # bluffItem : ITEMTYPE - the item that was promised
52 # pointDelta : integer - how your points were affected.
53 #
54 #
55 # Called after your agent battles another agent, to tell you how the battle goes.
56
57 function Results( foeName, isInstigatedByYou, winner, attItem, defItem, 
58                                   bluffItem, pointDelta )
59
60         # do nothing
61         1;
62
63 endfunction
64
65 # This invokes the matlab-link library, which allows your code to talk
66 # to the judging software. Do not remove this line.
67 source( "link/MATLAB/matlab-link.m" );

UCC git Repository :: git.ucc.asn.au