Picker bewegt sich nur bei Bedarf
Picker fährt Regal und Ebene nur an, wenn er sich nicht schon dort befindet.
This commit is contained in:
parent
872702dece
commit
f5c1bb68c9
|
|
@ -9,6 +9,10 @@ public class Picker {
|
||||||
static int[][] liste = new int[4][4];
|
static int[][] liste = new int[4][4];
|
||||||
static int[][] fehler = new int[4][4];
|
static int[][] fehler = new int[4][4];
|
||||||
|
|
||||||
|
// Position des Pickers
|
||||||
|
static int aktuelleRegalNr;
|
||||||
|
static int aktuelleEbeneNr;
|
||||||
|
|
||||||
static int zeileF = 0;
|
static int zeileF = 0;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
@ -61,8 +65,12 @@ public class Picker {
|
||||||
int fachNr = liste[i][3];
|
int fachNr = liste[i][3];
|
||||||
|
|
||||||
System.out.println("---------------------------");
|
System.out.println("---------------------------");
|
||||||
|
if (regalNr != aktuelleRegalNr) {
|
||||||
fahreRegalAn(regalNr);
|
fahreRegalAn(regalNr);
|
||||||
fahreEbeneAn(ebeneNr);
|
fahreEbeneAn(ebeneNr);
|
||||||
|
} else if (ebeneNr != aktuelleEbeneNr) {
|
||||||
|
fahreEbeneAn(ebeneNr);
|
||||||
|
}
|
||||||
fahreFachAn(fachNr);
|
fahreFachAn(fachNr);
|
||||||
|
|
||||||
if (pruefeWare(lager[regalNr - 1][ebeneNr - 1][fachNr - 1], i)) {
|
if (pruefeWare(lager[regalNr - 1][ebeneNr - 1][fachNr - 1], i)) {
|
||||||
|
|
@ -78,10 +86,12 @@ public class Picker {
|
||||||
|
|
||||||
static void fahreRegalAn(int regalNr) {
|
static void fahreRegalAn(int regalNr) {
|
||||||
System.out.println("Picker fährt Regal " + regalNr + " an.");
|
System.out.println("Picker fährt Regal " + regalNr + " an.");
|
||||||
|
aktuelleRegalNr = regalNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fahreEbeneAn(int ebeneNr) {
|
static void fahreEbeneAn(int ebeneNr) {
|
||||||
System.out.println("Picker fährt Ebene " + ebeneNr + " an.");
|
System.out.println("Picker fährt Ebene " + ebeneNr + " an.");
|
||||||
|
aktuelleEbeneNr = ebeneNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fahreFachAn(int fachNr) {
|
static void fahreFachAn(int fachNr) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue