From: Mart Lubbers Date: Mon, 22 Jun 2015 20:19:19 +0000 (+0200) Subject: update X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=HEAD;p=fp1415-soccerfun.git update --- diff --git a/src/MartLubbers.icl b/src/MartLubbers.icl deleted file mode 100644 index 65e62bf..0000000 --- a/src/MartLubbers.icl +++ /dev/null @@ -1,69 +0,0 @@ -implementation module Team_MartLubbers - -import Footballer - -Team_MartLubbers :: !Home !FootballField -> Team -Team_MartLubbers home field = -| home==West = westTeam -| otherwise = eastTeam -where - eastTeam = mirror field westTeam - westTeam = [keeper : fielders] - clubname = base_TeamName_MiniEffie +++ if (home == West) "W" "E" - keeper = MiniEffie clubname home field {zero & px=scale -0.5 field.flength} 1 - fielders = [ MiniEffie clubname home field {px=scale (-0.5*dx) field.flength,py=scale (0.5*dy) field.fwidth} nr - \\ (dx,dy) <- west_positions_fielders - & nr <- [2..] - ] - west_positions_fielders = [(0.20, 0.40) - ,(0.20,-0.40) - ,(0.23, 0.00) - ,(0.50, 0.45) - ,(0.50,-0.45) - ,(0.60, 0.00) - ,(0.70, 0.35) - ,(0.70,-0.35) - ,(0.90, 0.05) - ,(0.90,-0.05) - ] - -:: MiniMemory = { home :: !Home } - -MiniEffie :: !ClubName !Home !FootballField !Position !PlayersNumber -> Footballer -MiniEffie club home field position nr - = { playerID = {clubName=club,playerNr=nr} - , name = "MiniF." <+++ nr - , length = min_length - , pos = position - , nose = zero - , speed = zero - , skills = (Running, Kicking, Rotating) - , effect = Nothing - , stamina = max_stamina - , health = max_health - , brain = { memory = {home=home}, ai = minibrain field } - } - -minibrain :: !FootballField !(!BrainInput,!MiniMemory) -> (!BrainOutput,!MiniMemory) -minibrain field (input=:{referee,me}, memory=:{home}) -| i_am_close_to_the_ball - | i_can_see goal = (kick_the_ball, new_memory) - | otherwise = (turn_to_face goal, new_memory) -| i_can_see ball = (run_to_the_ball, new_memory) -| otherwise = (turn_to_face ball, new_memory) -where - new_memory = {home=if (any isEndHalf referee) (other home) home} - my_direction = me.nose - ball = getBall input - goal = centerOfGoal (other home) field - - i_am_close_to_the_ball = dist me ball < maxKickReach me - i_can_see pos = abs (bearing my_direction me pos) < rad (0.05*pi) - - run_to_the_ball = Move {direction=bearing zero me ball,velocity=speed_of_light} zero - turn_to_face pos = Move zero (bearing my_direction me pos) - kick_the_ball = KickBall {vxy={direction=my_direction,velocity=speed_of_light}, vz=ms 1.0} - speed_of_light = ms 299792458.0 - -base_TeamName_MiniEffie :: String -base_TeamName_MiniEffie = "Æsir" \ No newline at end of file diff --git a/src/Team_MartLubbers.icl b/src/Team_MartLubbers.icl index 9537ed1..0b2410f 100644 --- a/src/Team_MartLubbers.icl +++ b/src/Team_MartLubbers.icl @@ -177,4 +177,4 @@ distToLine a b c = (abs (((b.px-a.px)*(a.py-c.py))-((a.px-c.px)*(b.py-a.py))))/d d = sqrt(((b.px-a.px)*(b.px-a.px))+((b.py-a.py)*(b.py-a.py))) base_TeamName_MartLubbers :: String -base_TeamName_MartLubbers = "Æsir" \ No newline at end of file +base_TeamName_MartLubbers = "Æsir"