Learn

Sunday, 3 December 2017

How to Run JAVA POJO Object Models for Blocks World Example Artificial Intelligence Programming



POJO Object Models for Blocks World Example:

We will use the following three POJO classes (defined in the file DroolsBock- World.java as static inner classes). The first POJO class Block represents the state of one block:


public static class Block {

protected String name;
protected String onTopOf;
protected String supporting;

public Block(String name, String onTopOf, String supporting) {

this.name = name;
this.onTopOf = onTopOf;
this.supporting = supporting;

}

public String toString() {

return "[Block_" + this.hashCode() + " " +
name + " on top of: " + onTopOf +
" supporting: " + supporting+"]";

}

public String getName() {

return this.name;

}

public void setName(String name) {

this.name = name;

}

public String getOnTopOf() {

return this.onTopOf;

}

public void setOnTopOf(String onTopOf) {

this.onTopOf = onTopOf;

}

public String getSupporting() {

return this.supporting;

}

public void setSupporting(String supporting) {

this.supporting = supporting;

}
}

No comments:

Post a Comment