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:
commit
015d558afe
Binary file not shown.
@ -4,6 +4,10 @@ import java.util.Random;
|
||||
|
||||
public class Customer extends BuyerNodeBase {
|
||||
|
||||
public Customer(int startMoney) {
|
||||
super();
|
||||
}
|
||||
|
||||
public void consumeProduct() {
|
||||
int i = new Random().nextInt(getStorage().size());
|
||||
getStorage().remove(i);
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.node;
|
||||
|
||||
public class Distributor extends RetailerNodeBase {
|
||||
|
||||
public Distributor(int startMoney) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,10 @@ import cz.cvut.fel.sit.omo.foodchain.product.Product;
|
||||
|
||||
public class Farmer extends SellerNodeBase {
|
||||
|
||||
public Farmer(int startMoney) {
|
||||
super();
|
||||
}
|
||||
|
||||
public void generateProduct(Product product) {
|
||||
storeProduct(product);
|
||||
createRequirement(TransactionType.SALE, product.getProductType(), product.getName());
|
||||
|
||||
@ -32,7 +32,7 @@ public class NodeBase implements ChannelObserver {
|
||||
money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create();
|
||||
}
|
||||
|
||||
public NodeBase(int m) {
|
||||
public NodeBase(double m) {
|
||||
subscribedChannels = new HashMap<>();
|
||||
products = new LinkedList<>();
|
||||
refusedTranslations = new LinkedList<>();
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.node;
|
||||
|
||||
public class Processor extends RetailerNodeBase {
|
||||
|
||||
public Processor(int startMoney) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.node;
|
||||
|
||||
public class Seller extends RetailerNodeBase {
|
||||
|
||||
public Seller(int startMoney) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,13 +144,7 @@ public class Product
|
||||
this.currentOperation = currentOperation;
|
||||
}
|
||||
|
||||
public MonetaryAmount getMoney()
|
||||
{
|
||||
return money;
|
||||
}
|
||||
public MonetaryAmount getMoney() { return money; }
|
||||
|
||||
public void setMoney(MonetaryAmount money)
|
||||
{
|
||||
this.money = money;
|
||||
}
|
||||
public void setMoney(MonetaryAmount money) { this.money = money; }
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user