First attempt at a matlab link.
[progcomp10.git] / src / link / MATLAB / agents / ml_angel.m
1 #
2 # ml_angel.m
3 # matlab-link
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 # don't allow this file to be mistaken for a function file.
10 1;
11
12 # import various constants and utilities
13 source( "link/MATLAB/matlab-consts.m" )
14
15 # defence = Defend( foeName , foePromisedAttack );
16
17 # foeName: string - the name of your foe;
18 # foePromisedAttack : string - the item your foe promised to use
19 # defence: string - the item you wish to use to defend;
20 #
21 # Called when your agent needs to defend itself.
22
23 function defence = Defend( foeName, foePromisedAttack ) 
24
25         global rps;
26
27         defence = foePromisedAttack;
28
29 endfunction
30
31
32 # [attack, bluff] = Attack( foeName )
33 #
34 # foeName: string - the name of your foe
35 # attack: string - the actual attack you want to use
36 # bluff: string - the bluff attack that you say you will use.
37 #
38 # Called when your agent needs to attack another agent.
39
40
41 function [attack, bluff] = Attack( foeName )
42
43         global rps;
44
45         attack = RandomAttack();
46         bluff = attack;
47
48 endfunction
49
50 # Results( foeName, isInstigatedByYou, winner, attItem, defItem, bluffItem,
51 #          pointDelta )
52 #
53 # foeName: string - the name of your foe;
54 # isInstigatedByYou : 0=you defended/1=you attacked;
55 # winner : RESULTTYPE - who won
56 # attItem : ITEMTYPE - the item used to attack;
57 # defItem : ITEMTYPE - the item used to defend;
58 # bluffItem : ITEMTYPE - the item that was promised
59 # pointDelta : integer - how your points were affected.
60 #
61 #
62 #Called after your agent battles another agent, to tell you how the battle goes.
63
64 function Results( foeName, isInstigatedByYou, winner, attItem, defItem, 
65                                   bluffItem, pointDelta )
66
67         # do nothing
68         1;
69
70 endfunction
71
72 # This invokes the matlab-link library, which allows your code to talk
73 # to the judging software
74 source( "link/MATLAB/matlab-link.m" );

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