First attempt at a matlab link.
[progcomp10.git] / src / link / MATLAB / agents / ml_angel.m
diff --git a/src/link/MATLAB/agents/ml_angel.m b/src/link/MATLAB/agents/ml_angel.m
new file mode 100644 (file)
index 0000000..cde7837
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# ml_angel.m
+# matlab-link
+#
+# Created by Daniel Axtens on 28/07/10.
+# Licensed under an MIT-style license: see the LICENSE file for details.
+#
+
+# don't allow this file to be mistaken for a function file.
+1;
+
+# import various constants and utilities
+source( "link/MATLAB/matlab-consts.m" )
+
+# defence = Defend( foeName , foePromisedAttack );
+# 
+# foeName: string - the name of your foe;
+# foePromisedAttack : string - the item your foe promised to use
+# defence: string - the item you wish to use to defend;
+#
+# Called when your agent needs to defend itself.
+
+function defence = Defend( foeName, foePromisedAttack ) 
+
+       global rps;
+
+       defence = foePromisedAttack;
+
+endfunction
+
+
+# [attack, bluff] = Attack( foeName )
+#
+# foeName: string - the name of your foe
+# attack: string - the actual attack you want to use
+# bluff: string - the bluff attack that you say you will use.
+#
+# Called when your agent needs to attack another agent.
+
+
+function [attack, bluff] = Attack( foeName )
+
+       global rps;
+
+       attack = RandomAttack();
+       bluff = attack;
+
+endfunction
+
+# Results( foeName, isInstigatedByYou, winner, attItem, defItem, bluffItem,
+#          pointDelta )
+#
+# foeName: string - the name of your foe;
+# isInstigatedByYou : 0=you defended/1=you attacked;
+# winner : RESULTTYPE - who won
+# attItem : ITEMTYPE - the item used to attack;
+# defItem : ITEMTYPE - the item used to defend;
+# bluffItem : ITEMTYPE - the item that was promised
+# pointDelta : integer - how your points were affected.
+#
+#
+#Called after your agent battles another agent, to tell you how the battle goes.
+
+function Results( foeName, isInstigatedByYou, winner, attItem, defItem, 
+                                 bluffItem, pointDelta )
+
+       # do nothing
+       1;
+
+endfunction
+
+# This invokes the matlab-link library, which allows your code to talk
+# to the judging software
+source( "link/MATLAB/matlab-link.m" );
\ No newline at end of file

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