Adding TODO and fixing after-merging code
This commit is contained in:
parent
270654e5ea
commit
88543d0c68
@ -43,24 +43,25 @@ public class NodeFactory
|
||||
System.err.println("! Fatal error in NodeFactory: " + e.getMessage());
|
||||
}
|
||||
|
||||
switch (Objects.requireNonNull(nodeType))
|
||||
{
|
||||
case Farmer:
|
||||
n = new Farmer(startMoney);
|
||||
break;
|
||||
case Processor:
|
||||
n = new Processor(startMoney);
|
||||
break;
|
||||
case Distributor:
|
||||
n = new Distributor(startMoney);
|
||||
break;
|
||||
case Seller:
|
||||
n = new Seller(startMoney);
|
||||
break;
|
||||
case Customer:
|
||||
n = new Customer(startMoney);
|
||||
break;
|
||||
}
|
||||
// switch (Objects.requireNonNull(nodeType))
|
||||
// {
|
||||
// //TODO Money constructor
|
||||
// case Farmer:
|
||||
// n = new Farmer(startMoney);
|
||||
// break;
|
||||
// case Processor:
|
||||
// n = new Processor(startMoney);
|
||||
// break;
|
||||
// case Distributor:
|
||||
// n = new Distributor(startMoney);
|
||||
// break;
|
||||
// case Seller:
|
||||
// n = new Seller(startMoney);
|
||||
// break;
|
||||
// case Customer:
|
||||
// n = new Customer(startMoney);
|
||||
// break;
|
||||
// }
|
||||
|
||||
String[] subs = subsChannels.split(";");
|
||||
//todo Node subscription to channels by parser data
|
||||
@ -68,7 +69,7 @@ public class NodeFactory
|
||||
for (String s : subs)
|
||||
{
|
||||
ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance();
|
||||
n.subscribeToChannel(temp.findByName(s));
|
||||
// n.subscribeToChannel(temp.findByType(s)); //TODO String to enum
|
||||
}
|
||||
|
||||
return n;
|
||||
|
||||
@ -74,9 +74,9 @@ public class NodeBase implements ChannelObserver {
|
||||
}
|
||||
|
||||
public Transaction readNextTransaction(ChannelBase channel) {
|
||||
|
||||
|
||||
return channel.getNextTransaction();
|
||||
//TODO
|
||||
return null;
|
||||
// return channel.getNextTransaction();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ public class Product
|
||||
this.money = Monetary.getDefaultAmountFactory().setCurrency("USD").setNumber(0).create();
|
||||
}
|
||||
|
||||
//TODO money int constructor
|
||||
public Product(String name, ProductType productType, MonetaryAmount money)
|
||||
{
|
||||
this.name = name;
|
||||
|
||||
@ -4,7 +4,7 @@ import cz.cvut.fel.sit.omo.foodchain.node.Customer;
|
||||
|
||||
public class ConsumeProductStep extends ScenarioStep {
|
||||
|
||||
private Customer node;
|
||||
private final Customer node;
|
||||
|
||||
public ConsumeProductStep(Customer node) {
|
||||
this.node = node;
|
||||
|
||||
@ -7,8 +7,8 @@ import cz.cvut.fel.sit.omo.foodchain.product.Product;
|
||||
|
||||
public class GenerateProductStep extends ScenarioStep {
|
||||
|
||||
private Farmer node;
|
||||
private Product product;
|
||||
private final Farmer node;
|
||||
private final Product product;
|
||||
|
||||
public GenerateProductStep(Farmer node) {
|
||||
this.node = node;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user