⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 firebrigadeconstantsconditions.java

📁 2004年robotcup世界冠军源代码
💻 JAVA
字号:
package MRL.FireBrigade;import yab.agent.object.Property;import yab.agent.Condition;import yab.agent.object.*;public final class FireBrigadeConstantsConditions {  private FireBrigadeConstantsConditions() {  }  //----------------------Constants--------------------------------//  static final double STAGGER_RATE = 1.0;  static final int BURNING_TIME_OF_AN_EARLY_FIRE = 3;  static final int EXTINGUISHABLE_BURNING_TIME_BY_ONE = 6;  static final int EXTINGUISHABLE_BURNING_TIME_BY_MANY = 17;  public static final double URGENT_FIRE_PRIORITY = 1.5;  public static final double VERY_URGENT_FIRE_PRIORITY = 4.0;  public static final int RADIUS_OF_NEIGHBOURS_FOR_FIRE_PRIORITY = 18000;  public static final double      PRIORITY_INCREASING_RATE_BY_SURROUNDING_NO_BURNEDS =      2.5;  public static final double PRIORITY_ATTRITION_RATE_BY_SURROUNDING_FIRES =      0.75;  public static final double PRIORITY_INCREASING_RATE_BY_SURROUNDING_PUT_OFFS =      1.0;  public static final double      PRIORITY_ATTRITION_RATE_BY_SURROUNDING_BURNED_OUTS =      1.0;  //---------------------------------------------------------------//  //-----------------Conditions-Properties-------------------------//  static final Property      FIERYNESS_PRP = Property.get("Building", "fieryness"),                      BURNING_TIME_PRP = Property.get("Building", "burningTime"),                                         ENTRANCE_PRP = Property.get("Building",      "entrance"),      BUILDING_AREA_TOTAL_PRP = Property.get("Building", "buildingAreaTotal"),                                BUILDING_AREA_GROUNG_PRP = Property.get(      "Building", "buildingAreaGround");  public static final Condition NOT_BURNING_C = new Condition() {    public boolean eval(Object obj) {      return (((Building) obj).isUnburned());    }  };  public static final Condition IS_BURNING_C = new Condition() {    public boolean eval(Object obj) {      return (((Building) obj).isBurning());    }  };  public static final Condition IS_PUT_OFF_C = new Condition() {    public boolean eval(Object obj) {      return (((Building) obj).isPutOut());    }  };  static final Condition      IS_BURNING_CND = FIERYNESS_PRP.gte(1).and(FIERYNESS_PRP.lte(3)),                       IS_EARLY_CND = BURNING_TIME_PRP.lte(      BURNING_TIME_OF_AN_EARLY_FIRE);  static final Property MOTIONLESS_POSITION_PRP = new Property() {    public Object eval(Object obj) {      return ((RealObject) obj).motionlessPosition();    }  };  static final Property BURNING_CIVS_PRP = new Property() {    public Object eval(Object obj) {      return obj;    }  };  static final Condition BUILDING_C = new Condition(){    public boolean eval(Object obj){      if(obj instanceof Building){        return true;      }      else return false;    }  };  static final Condition IS_ENTRANCE_IN_THE_ROAD = new Condition() {    public boolean eval(Object obj) {      if (((Building) obj).entrance() instanceof Node ||          ((Building) obj).entrance() instanceof Road) {        return true;      } else {        return false;      }    }  };  static final Property CIV_MO_PRP = new Property(){    public Object eval(Object obj){        return ((Civilian) obj).motionlessPosition();    }  };  //--------------------------------------------------------------//}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -