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

Implement Latex Table generation #330 #490

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

marwenbenhajhassine
Copy link

@marwenbenhajhassine marwenbenhajhassine commented May 11, 2024

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

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.
@marwenbenhajhassine marwenbenhajhassine changed the title My contribution - Closes #330 My contribution - #330 May 11, 2024
Copy link
Collaborator

@manoelcampos manoelcampos left a 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.

@manoelcampos manoelcampos marked this pull request as draft May 16, 2024 13:53
@manoelcampos manoelcampos changed the title My contribution - #330 Implement Latex Table generation #330 May 16, 2024
@marwenbenhajhassine marwenbenhajhassine marked this pull request as ready for review May 17, 2024 06:59
@marwenbenhajhassine

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Latex results table
2 participants