-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Implement Latex Table generation #330 #490
base: master
Are you sure you want to change the base?
Implement Latex Table generation #330 #490
Conversation
Created a new class named LatexTable in the org.cloudsimplus.builders.tables package. The LatexTable class provides functionality for building LaTeX tables. Implemented methods for adding columns and rows to the table. Added a method for generating the LaTeX code for the table. Incorporated column specifiers to define alignment and formatting options for columns. Improved code readability and maintainability by encapsulating table-building functionality within the LatexTable class.
Created a new class named LatexTableColumn in the org.cloudsimplus.builders.tables package. The LatexTableColumn class represents a column in a LaTeX table. Added methods for retrieving the column name and specifier. Enhanced modularity and organization to manage individual table columns.
LatexTableBuilder class in the org.cloudsimplus.builders.tables package facilitates the construction of LaTeX tables. It was used to test the output of the tables on the cloudlets of the BasicFirstExample.java
File of simple simulation for testing purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @marwenbenhajhassine
Thanks for your contribution. This feature will be great for researchers that uses LaTeX.
However, I see many issues in the implementation.
You just created a bunch of new classes that don't use the existing class hierarchy.
Every new class must extend an existing class, namely:
- a new Table must extends AbstractTable
- a new Column must extends AbstractTableColumn
You must not create a LatexTableBuilder class, since the CloudletsTableBuilder accepts a Table as a constructor parameter. This way, it will work with any format (any class that implements the Table interface).
The major issue in the PR is that it has lots of duplicated code.
Code duplication is the reason that CloudSim became so buggy and the main reason that CloudSim Plus exists. My primary intention with CloudSim Plus was to remove the huge amount of code duplication in CloudSim.
Therefore, this PR needs a major rewrite in order to follow CloudSim Plus requirements.
Let me know if you need help understanding how the mentioned classes works.
And thanks for contributing.
This comment was marked as resolved.
This comment was marked as resolved.
- Updated new LatexTable class to extend AbstractTable. - Updated new LatexColumn class to extend AbstractTableColumn. - Removed LatexTableBuilder class so that the updated code can be used on CloudletsTableBuilder with a Table constructor parameter, ensuring compatibility with any Table format. - Eliminated duplicated code to maintain codebase quality and adhere to CloudSim Plus principles. - Improved overall integration with existing class hierarchy.
It was there for testing purposes.
I have implemented a LatexTable class, a LatexTableColumn class, and a LatexTableBuilder class. Each with functionalities explained in the separate commits.
I have tested the output of my work by adding a modified version of BasicFirstExample.java in cloudsimplus/src/main/java/org/cloudsimplus that creates a latex table of the cloudlets data. This file is found in the last commit of my forked cloudsimplus repository.
Let me know if you have any feedback on my work and how to improve it.
Close #330