mathrpg / ispd-plugin Goto Github PK
View Code? Open in Web Editor NEWThis project forked from gspd-unesp/ispd
iSPD, re-structured to follow a plugin architecture (also known as a microkernel architecture)
License: GNU General Public License v3.0
This project forked from gspd-unesp/ispd
iSPD, re-structured to follow a plugin architecture (also known as a microkernel architecture)
License: GNU General Public License v3.0
The help window is very primitive, and contains almost no content. It can be removed and, futurely, replaced with an online wiki.
Update schedule/allocation code to use factories (or perhaps even a Map
of Supplier
s) instead of reflection to instance classes.
Reflection makes the code harder to work with and potentially more brittle.
If reflection is ever re-introduced, it should be dynamically determined via annotations, not hardcoded strings.
Changes:
@Policy
annotation which is used to prevent 'unused class' warningsTests may be added on the way.
Reproduction:
File contents will be:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE system SYSTEM "iSPD.dtd">
<system version="2.2"/>
This is invalid XML and may produce undesirable behavior when used by the application.
Strangely, both gui and cli applications are fine when reading the model back up again. Surely, a warning should be emitted?
Code always creates a SimulacaoSequencial
instance, which is unfit for cloud simulations.
It is unknown what kind of behavior is observed when simulating cloud models.
Models do seem to be parsed appropriately. However, a RedeDeFilas instance is always created.
This could be mitigated via the Grid-Cloud Unification milestone. With one RedeDeFilas
and Simulacao
class for all types of models, this wouldn't be a problem.
The code makes heavy use of System.out for debugging, specially in the motor.
It would be better to remove this hard-wired dependency, and use java's logging facility instead. Logging levels can be configured to process logs only when needed, and log processors can emit the log messages to whichever output is preferred.
For now, removing the System.out.print...
statements will suffice. This will simplify the code and improve maintainability.
Both motor
and policy
packages will be impacted by this change.
This is a long-term issue.
The goal is to remove all static analysis warnings, and all warnings that happen during compilation.
As the time of writing (July 16th, 2023) there were over 100 compile-time warnings, and inummerable IDE warnings left in the project.
SuppressWarnings
should only be used with a very good reason to do so. And even then, it probably shouldn't.
The application uses the project's home directory too much. Currently, it:
Erros
folder to save logs of critical errorspolicies
folder for the source and bytecode of user-made scheduling and allocation policiesconfiguration.xml
file, if none is present on startupThis makes code maintenance untidy, can introduce unwanted race conditions while running multiple instances of the application, and it is unknown whether this behavior works when the application is packaged into a .jar
file.
Where possible, such dependencies on the OS's file system should be removed. Where not, there needs to be a well planned-out space for such files.
A preferrable alternative would be to encapsulate all of these behaviors on a folder, .ispd
, and place this folder within the OS's default location for application configuration (i.e., %appdata%
on Windows and .config
on Linux).
Perhaps the user should be allowed to determine where the application folder would be located, or where specific things should be (i.e., select a location for custom policies). If this is done, this choice would probably still need to be preserved in a known place.
The System Error window, which appears on uncaught runtime exceptions, can be improved in two ways:
This is very low priority.
When attempting to run a simulation with a user-defined policy, the user will instead come across a ClassNotFound exception.
Solving #21 may help progress this issue as well.
Reproduction:
Error window shows up with the error 'One or more parameters have not been configured.', which is an error indicating that the parser has not identified any icon elements with the 'master' attribute.
Solution
WrappedDocument::hasNoMasters
only considers 'machine' elements, need to consider 'cluster' as well.
Resources (such as images, dtd & html files) are gathered and used very liberally in the application, making it very difficult to determine which resources are actually used, and where.
It would be incalculably better to abstract away resource fetching and usage, and their paths as well.
This could also aid future testing, since this "ResourceManager
" concept could be mocked.
Furthermore, once this concept is introduced and used the application, moving resources to the standard folder will become trivially easy. (See #7)
New icons appear in their configuration window to have a RoundRobin
policy by default. However, if attempting to run a simulation, the user will encounter a Could not load policy '---'!
error.
Two acceptable solutions:
RoundRobin
policy (or whichever policy is default for their use case).Will help test-drive critical logging behavior.
Reproduction:
For example:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE system SYSTEM "iSPD.dtd">
<system version="2.3">
<owner id="user1" powerlimit="100.0"/>
</system>
Resource files are scattered throughout the code, and are not (as one might intuit) located in their designated resources/
folder.
TODO:
.getClass().getResource()
idiom, and potential alternativesRelevant resources:
arquivo/xml/dtd
gui/{html, imagens}
idioma
, potentiallyThese two files deserve a cleanup.
enums
would be more appropriateReproduction:
Simulation attempts to run, with a runtime error occuring soon after due to the impossibility of creating an instance of the scheduler class.
Preferrably, the 'Simulate' button should show an early error and not allow the simulation to run.
A step toward command/query separation, 'Simulation' is reference inside service centers to schedule (and remove) events. It would be better for the methods to return all new events, or perhaps a 'command' object with addition and removal parameters.
It is debatable if events should be removed from the simulation queue at all, or if service centers should merely ignore invalid events. If the latter, removal does not need to be supported in the new interface.
This would also aid testability, since then service centers could be tested in isolation, without needing an entire 'simulation' object around them.
Run the TerminalApplication
class, setting the argument -e
with 0 or negative. As long as no -t
option is set (number of threads), this value's range is not validated.
Specially since the iconic/simulable model interpreting removal (and #26), the documentation is extremely outdated.
The docs
folder should be cleaned up, leaving only the example models and traces used to test application functionality.
Improve project's file structure to be more in line with the java ecosystem.
Doing this will also add the opportunity to use other JVM languages in the project.
User generated policies are, in theory, a great asset: the user can test various scheduling and allocation policies without needing to leave the application. It greatly reduces the iteration time and allows for 'playful discovery' of new techniques.
That being said, the system implemented currently is undesirable. It is best to remove it for now, and cogitate re-introducing it after the project architecture has been stablished.
Windows maintain an instance of ResourceBundle
, which complicates UI code severely.
The ability to switch languages in runtime complicates the MainWindow's code greatly (and some other windows' too).
There is no default language bundle for the application.
The application is in no state to support multiple languages currently
Lastly, the language bundle(s) have no purpose being within the source code.
This is another facet of the code that overcomplicates it and makes it harder to deal with.
Once the serialization system is re-worked, these features can be reintroduced via plugins.
TODO:
Standard workload format support will be reworked futurely as well. It won't be removed for now since it is overly coupled to the code.
A library with more options for fluent assertions. Can be used in combination with Hamcrest, and other testing libraries.
The application takes some exclusive code paths in case it is running from a JAR, like extracting scheduling policies' code.
This part of the application is neigh impossible to test, and very difficult to work with.
It will be better to re-engineer this part of the application to make it more testable.
Setup the necessary workflows for automated testing in Github.
Testing should be done on PRs; PRs should only be merged if all tests pass.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.