# **************************************************************************** # CUI # # The Advanced Framework for Simulation, Integration, and Modeling (AFSIM) # # The use, dissemination or disclosure of data in this file is subject to # limitation or restriction. See accompanying README and LICENSE for details. # **************************************************************************** behavior create_cap-routes script_debug_writes off script_variables Array> mCapRoutes = Array>(); #mCapRoutes[0] = Map(); #mCapRoutes[0].Set("route name", "GOALIE_CAP_CCW_ORBIT"); #mCapRoutes[0].Set("location", WsfGeoPoint.Construct(12.60313, 117.37702, 40000)); #mCapRoutes[0].Set("heading", 140.0); #mCapRoutes[0].Set("priority", 1000.0); #mCapRoutes[0].Set("max winners", 1); #mCapRoutes[0].Set("fez_zone", "lane_2"); end_script_variables on_init if (PROCESSOR.IsA_TypeOf("WSF_RIPR_PROCESSOR")) { foreach( Map map in mCapRoutes) { //create a "cap-route" job string routeName = (string) map["route name"]; WsfGeoPoint location = (WsfGeoPoint)map["location"]; double heading = (double) map["heading"]; double priority = (double) map["priority"]; int maxWinners = (int) map["max winners"]; string zoneName = (string) map["fez_zone"]; string unique_desc = write_str("cap-route_", routeName, "_", location.Latitude(), "_", location.Longitude()); writeln_d("CREATING CAP ROUTE JOB: ", unique_desc); WsfRIPRJob temp = WsfRIPRJob.Create( ((WsfRIPRProcessor)PROCESSOR), "cap-route", unique_desc, priority, maxWinners ); temp.SetData( "location", location ); temp.SetData( "heading", heading ); temp.SetData( "route name", routeName ); temp.SetData( "for_air", 1 ); temp.SetData( "fez_zone", zoneName); ((WsfRIPRProcessor)PROCESSOR).AddJob(temp); } } end_on_init precondition writeln_d("precondition create_cap-routes"); if (!PROCESSOR.IsA_TypeOf("WSF_RIPR_PROCESSOR")) { return Failure("behavior not attached to a RIPR processor!"); } //((WsfRIPRProcessor)PROCESSOR) return false; end_precondition execute writeln_d("executing create_cap-routes"); end_execute end_behavior