Adding TODO and fixing after-merging code

This commit is contained in:
Nikita Iryupin 2020-12-25 19:03:26 +01:00
parent 270654e5ea
commit 88543d0c68
5 changed files with 27 additions and 25 deletions

View File

@ -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;

View File

@ -74,9 +74,9 @@ public class NodeBase implements ChannelObserver {
}
public Transaction readNextTransaction(ChannelBase channel) {
return channel.getNextTransaction();
//TODO
return null;
// return channel.getNextTransaction();
}

View File

@ -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;

View File

@ -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;

View File

@ -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;