// create rule for Normal Fishing Ship
/**
* Creates the rules for normal fishing ship.
*/
void createRulesForNormalFishingShip(){
Unit ship = TDB.This().get("TDBROOT.MODEL.WORLD.SHIPS."+getName());
Unit location = ship.get("Location");
//Determine tree ports scenario
String strPrevState = "";
int randSceario = getRandomOnThree();
Rule_Unit sRule = null;
if( randSceario == 0 ){//one port scenario
int randPort = getRandomOnThree();
String strFirst = World.This().mapNearestFishingArea.get(location.getData()).get(randPort);
sRule = newRules();
strPrevState = newRulesStarting( sRule, strFirst, getStartTimeForFishingShip() );
strPrevState = newRulesMoving( sRule, strPrevState, strFirst, location.getData(), "Fishing" , (int)(Math.random()*60)+100);
}else
if( randSceario == 1 ){//two port scenario
int randPort = getRandomOnThree();
String strFirst = World.This().mapNearestFishingArea.get(location.getData()).get(randPort);
int randPort2 = getRandomOnThree(randPort);
String strSecond = World.This().mapNearestFishingArea.get(location.getData()).get(randPort2);
sRule = newRules();
strPrevState = newRulesStarting(sRule, strFirst, getStartTimeForFishingShip() );
strPrevState = newRulesMoving( sRule, strPrevState, strFirst, strSecond, "Fishing", (int)(Math.random()*60)+100 );
strPrevState = newRulesMoving( sRule, strPrevState, strSecond, location.getData(), "Fishing", (int)(Math.random()*60)+100 );
}else{//tree or more port scenario
int randPort = getRandomOnThree();
String strFirst = World.This().mapNearestFishingArea.get(location.getData()).get(randPort);
int randPort2 = getRandomOnThree(randPort);
String strSecond = World.This().mapNearestFishingArea.get(location.getData()).get(randPort2);
int randPort3 = getRandomOnThree(randPort, randPort2);
String strThird = World.This().mapNearestFishingArea.get(location.getData()).get(randPort3);
sRule = newRules();
strPrevState = newRulesStarting(sRule, strFirst, getStartTimeForFishingShip() );
strPrevState = newRulesMoving( sRule, strPrevState, strFirst, strSecond, "Fishing", (int)(Math.random()*60)+100 );
strPrevState = newRulesMoving( sRule, strPrevState, strSecond, strThird, "Fishing", (int)(Math.random()*60)+100 );
strPrevState = newRulesMoving( sRule, strPrevState, strThird, location.getData(), "Fishing", (int)(Math.random()*60)+100 );
}
newRulesEnding( sRule, strPrevState, location.getData(), "Anchoring" );
}