First attempt at a matlab link.
[progcomp10.git] / src / link / MATLAB / ml_agent_template.m
diff --git a/src/link/MATLAB/ml_agent_template.m b/src/link/MATLAB/ml_agent_template.m
new file mode 100644 (file)
index 0000000..01d6d58
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# your-agent-name-here.m
+# Your Name Here
+#
+# Created by Daniel Axtens on 28/07/10.
+# Licensed under an MIT-style license: see the LICENSE file for details.
+#
+
+# 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 ) 
+
+       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 )
+
+       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. Do not remove this line.
+source( "link/MATLAB/matlab-link.m" );
\ No newline at end of file

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