Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings in Elevator and Zoning classes #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Elevator.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ public void zoningThread(){
@Override
public void run() {

int Z = new Double(Math.ceil((double) getN() / getL())).intValue();
// int Z = new Double(Math.ceil((double) getN() / getL())).intValue();
int Z = Double.valueOf(Math.ceil((double) getN() / getL())).intValue();


while (true){

Expand Down
8 changes: 6 additions & 2 deletions src/Zoning.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ public class Zoning {
*/
public int choseElevator(int L, int N, int floor){

int Z = new Double(Math.ceil((double) N / L)).intValue(); // Z is the number of zones
// int Z = new Double(Math.ceil((double) N / L)).intValue(); // Z is the number of zones
int Z = Double.valueOf(Math.ceil((double) N / L)).intValue(); // Z is the number of zones


// return (new Double(Math.floor((double) floor / Z)).intValue());
return Double.valueOf(Math.floor((double) floor / Z)).intValue();

return (new Double(Math.floor((double) floor / Z)).intValue());
}
}