Here basic story of my project: Imagine that one little ship has got one big store place.We also know exactly measurements of the this storage place.
For example:storage place dimensions length=50 meters, height=15meters, width=20meters
Users should add input values(x,y,z) of products in the storage.I will declare some variables like x(length), y(height), z(width) for product sizes.
And I want to fill the storage with maximum efficiency.So how should I start, and which type methods should I use and I need some advice ty guys
Dave Tolls wrote:
Randall Twede wrote:
Here my codes, I wrote some points but I couldn't create 3d product objects, just calculatin x,y,z and collecting in same columns.But system has to collect product by product.
Container.java (storage page)
Product.java (Product page)
Main.java (Main Page)
Dave Tolls wrote:The code doesn't help me, because I have no idea what the algorithm for cargo loading is.
All I can ask is "does it work?"
When I try to run it. x, y and z dimensions just collecting in same type. For example when we add two products ( first product x:3 y:4 z:5 second product x:6 y:7 z:8 output-->x:9 y:11 z:13) just collection same type columns and its wrong because we have to calculate 3d objects.These codes are not recognise 3d objects just calculating same column values.Sorry my poor english
when we add two products ( first product x:3 y:4 z:5 second product x:6 y:7 z:8 output-->x:9 y:11 z:13) just collection same type columns and its wrong because we have to calculate 3d objects
WHY is that wrong? What do you expect the correct answer to be? What is your algorithm that defines "adding two products"? You need to tell us in English - not in code - how you expect to add these two things together.
Also, you need to define what "maximum efficiency" is. If i'm not mistaken, the "packing problem" (which is what I believe this question is about) hasn't been solved, so how you expect do do in in your code escapes me.
you should understand that programming is really 80% THINKING, and only 20% TYPING. If you don't have a rock-solid plan on how to pack the boat before you write your first line of code, you are doomed.
I added your problem to our Beginning Java forum too, that fits to there too, I hope you're fine with that.
dylan payne wrote:Here my codes, I wrote some points but I couldn't create 3d product objects, just calculatin x,y,z and collecting in same columns.But system has to collect product by product.
Anyway, I've revised your 3 classes you wrote. Please stop right there. Did you draw class diagram?
Honestly, you got full bunch of problems there, starting with poorly chosen variable names "iteratorX/Y/Z" and going towards all that code crammed to a main method without given any context to it what is happening there.
I'm afraid you'll have to start over. I'm sorry to say that.
You might have your assignment requirements somewhere written and could post it here?
fred rosenberger wrote:
Imagine 3d room defining dimentions with x(length), y(height), z(width).I will declare room sizes and start to throw some products in it.Until completely filled.For example room length 1000, we are used 999 and next product is more than 1 meter so its done system cant throw the next product bec its full filled.User adding products with input method, they will right x,y,z sizes and system will add products in the room.
At the starting point (0,0,0) I want to put the objects one by one in this order but I couldn't create 3d dimension, I just create the dimensions and system still calculating and adding (x,y,z) same values in same columns.How can I make 3d