convert java code to matlab code

1 次查看(过去 30 天)
nadia nadi
nadia nadi 2022-5-6
Hello,
I need to convert this code to matlab. I have no idea about java. could anyone help me please.
public class NextFit extends Packing {
protected final boolean shouldDecrease = false;
public NextFit(double[] items) {
super(items);
}
@Override
protected void pack(double item) {
int binSize = this.bins.size();
boolean canFit = binSize > 0 && this.bins.get(binSize - 1).remainingCapacity >= item;
int binIndex = binSize - (canFit ? 1 : 0);
this.addItem(item, binIndex);
}
@Override
protected boolean shouldDecrease() {
return this.shouldDecrease;
}
}
Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by