convert java code to matlab code

1 visualización (últimos 30 días)
nadia nadi
nadia nadi el 6 de Mayo de 2022
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

Respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by