Author Topic: [Script AI] Fahrzeugwahl  (Read 382 times)

0 Members and 1 Guest are viewing this topic.

Offline Frank

[Script AI] Fahrzeugwahl
« on: March 27, 2017, 09:33:39 AM »
Existiert ein Anhänger, dann wird immer diese Kombi genommen, auch wenn es einen besseren LKW ohne Anhänger gibt. Selbst dann, wenn die Kombi mit Anhänger veraltet ist.

sqai - prototyper.nut Zeile 175 rum


Quote
...
         if (test.can_be_last()  &&  !c.missing_freight  &&  c.min_top_speed >= min_speed) {
            // TODO valuate this candidate
            //if (valuate) {
               local value = valuate.call(getroottable(), c)
//                print(" === " + value)
               //if (best==null  ||  value > best_value) {
                  if (best==null) {
              best = c 
              best_value = value
            } else {
              if (c.max_speed > best.max_speed && c.capacity > best.capacity) {   //max_speed
            //if (c.capacity > 5) {     //c.capacity > best.capacity
                best = c 
                best_value = value
              } else if (c.max_speed > best.max_speed) {
                best = c 
                best_value = value
              } else if (c.capacity > best.capacity) {
                best = c 
                best_value = value
              }
            }
               //}
            //}
            //else {
               // no valuator function -> take first valid convoy and return
               //best = c;
               //break
            //}

//             print("..... ***")
         }
...