Merge branch 'develop' into feature/factory_impl

# Conflicts:
#	src/main/java/cz/cvut/fel/sit/omo/foodchain/factory/NodeFactory.java
#	src/main/java/cz/cvut/fel/sit/omo/foodchain/product/Product.java
This commit is contained in:
Daniel Poustka 2020-12-26 10:26:27 +01:00
commit 015d558afe
8 changed files with 26 additions and 12 deletions

Binary file not shown.

View File

@ -4,6 +4,10 @@ import java.util.Random;
public class Customer extends BuyerNodeBase { public class Customer extends BuyerNodeBase {
public Customer(int startMoney) {
super();
}
public void consumeProduct() { public void consumeProduct() {
int i = new Random().nextInt(getStorage().size()); int i = new Random().nextInt(getStorage().size());
getStorage().remove(i); getStorage().remove(i);

View File

@ -1,4 +1,8 @@
package cz.cvut.fel.sit.omo.foodchain.node; package cz.cvut.fel.sit.omo.foodchain.node;
public class Distributor extends RetailerNodeBase { public class Distributor extends RetailerNodeBase {
public Distributor(int startMoney) {
super();
}
} }

View File

@ -5,6 +5,10 @@ import cz.cvut.fel.sit.omo.foodchain.product.Product;
public class Farmer extends SellerNodeBase { public class Farmer extends SellerNodeBase {
public Farmer(int startMoney) {
super();
}
public void generateProduct(Product product) { public void generateProduct(Product product) {
storeProduct(product); storeProduct(product);
createRequirement(TransactionType.SALE, product.getProductType(), product.getName()); createRequirement(TransactionType.SALE, product.getProductType(), product.getName());

View File

@ -32,7 +32,7 @@ public class NodeBase implements ChannelObserver {
money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create(); money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create();
} }
public NodeBase(int m) { public NodeBase(double m) {
subscribedChannels = new HashMap<>(); subscribedChannels = new HashMap<>();
products = new LinkedList<>(); products = new LinkedList<>();
refusedTranslations = new LinkedList<>(); refusedTranslations = new LinkedList<>();

View File

@ -1,4 +1,8 @@
package cz.cvut.fel.sit.omo.foodchain.node; package cz.cvut.fel.sit.omo.foodchain.node;
public class Processor extends RetailerNodeBase { public class Processor extends RetailerNodeBase {
public Processor(int startMoney) {
super();
}
} }

View File

@ -1,4 +1,8 @@
package cz.cvut.fel.sit.omo.foodchain.node; package cz.cvut.fel.sit.omo.foodchain.node;
public class Seller extends RetailerNodeBase { public class Seller extends RetailerNodeBase {
public Seller(int startMoney) {
super();
}
} }

View File

@ -144,13 +144,7 @@ public class Product
this.currentOperation = currentOperation; this.currentOperation = currentOperation;
} }
public MonetaryAmount getMoney() public MonetaryAmount getMoney() { return money; }
{
return money;
}
public void setMoney(MonetaryAmount money) public void setMoney(MonetaryAmount money) { this.money = money; }
{
this.money = money;
}
} }