This file lists modifications introduced by each version.
- Empty
1.2.0 - 2020/02/12
Bug fixes in ClockManager:
-
The modification of the
ClockManager
's internal time value (the one actually used by theTopology
) now coincides with the ticking of theClock
Now, the clock is first incremented and then the
Scheduler
is called. It was previously swapped, resulting in some user interactions happening before the call to theScheduler
(and thus theMessageEngine
and allNode.onClock()
). Everything is now properly synchronized.
Symbol modification in ClockManager
-
ClockManager.currentTime()
now returns anint
instead of anInteger
This value could never be
null
. The return value being an object was a remnant of previous versions.
Some changes have been applied in an effort to simplify, clarify and speed-up the message engine system.
-
MessageEngine
is now an interface- A
reset()
method has been added - It does not handle delays anymore
- A
-
The former
MessageEngine
has been renamed toDefaultMessageEngine
io.jbotsim.core.MessageEngine
->io.jbotsim.core.DefaultMessageEngine
- It does not handle delays (see
DelayMessageEngine
) - It speeds-up former check on link existence
- It does not handle delays (see
-
A specific
DelayMessageEngine
has been re-created injbotsim-core
/io.jbotsim.core
-
It handles instantaneous delays better than the former
MessageEngine
used to -
It also handles general delays better than the former
MessageEngine
used to -
A new
DelayMessageEngine.disableLinksContinuityChecks()
method has been addedThis method prevents the system from checking the existence of the link each step while it is delayed. The check still remains at the end of the sending round and before the delivery round. This speeds message processing up when you send a lot of delayed messages in a static environment.
-
AsyncMessageEngine
andRandomMessageEngine
implementations have been modified to benefit from the newDelayMessageEngine
capabilities -
RandomMessageEngine
has been renamed intoRandomDelayMessageEngine
jbotsim-extras-common
/io.jbotsim.contrib.messaging.RandomMessageEngine
->io.jbotsim.contrib.messaging.RandomDelayMessageEngine
-
-
Test classes and examples have been added to showcase all MessageEngines behaviors
If you used to inherit from MessageEngine
, you have several options:
- inherit from
DefaultMessageEngine
(no delay feature) - inherit from
DelayMessageEngine
(has delay feature) - actually implement the
MessageEngine
interface
Bug fixes in Topology:
-
Topology.restart()
andTopology.clearMessages()
now properly remove delayed messages [issue 83]This is delegated to the new
MessageEngine.reset()
method.
New symbols in Node:
-
Node.hasNeighbor(Node)
,Node.hasInNeighbor(Node)
,Node.hasOutNeighbor(Node)
have been created [issue 85]These methods allow you to directly test the presence of the provided
Node
in the neighborhood of the object on which they are called. Please see documentation for details.
Modifications in Node:
Node.getOutNeighbors()
has been improved, avoiding unnecessary copies [issue 85]
New symbol in Message:
Message.isRetryModeEnabled()
accessor has been created [issue 85]
Behavior modifications in TikzTopologySerializer:
-
Directed links are now supported
Directed links are properly exported (using
"->"
option). This supposes thatTopology.getOrientation()
returnsDIRECTED
. -
TikZ colors are now better supported
-
The previous scale parameter is now a proper scale factor
Its previous default value was
50
. It is now1/50.
, resulting in the same default value.
Symbol modifications in TikzTopologySerializer:
-
The
TikzTopologySerializer.DEFAULT_EOL
constant has been addedThis constant sets the value of the default End-Of-Line delimiter:
"\n"
. -
The
TikzTopologySerializer.DEFAULT_SCALE_FACTOR
constant has been addedThis constant sets the default scale factor that must be applied to the distance between nodes:
1/50
. -
A new constructor
TikzTopologySerializer(String, double)
has been addedThis constructor allows to specify custom values for both the EOL and the scale factor.
-
exportTopology(Topology topology, double scaleFactor)
is nowprotected
It was previously
public
. You can achieve the same behavior by using the new constructor.
jbotsim-icons
/io.jbotsim.ui.icons
-
A fully transparent new icon has been added [issue 84]
jbotsim-icons
/io/jbotsim/ui/icons/transparent.png
As usual, it's path can be accessed using the corresponding constant
Icons.TRANSPARENT
.
Bug fix in JNode:
- The wired
Link
created between two nodes using the Swing UI (start a right click on the first and drag to the second before releasing the button) now takesTopology.getOrientation()
into account instead of always creating undirected links
1.1.1 - 2019/09/26
In order to better match the behavior introduced around Topology.getOrientation()
in [issue 49], the
following modifications have been applied:
-
Topology.addConnectivityListener(ConnectivityListener, Orientation)
andTopology.removeConnectivityListener(ConnectivityListener, Orientation)
have been added -
Topology.addConnectivityListener(ConnectivityListener, boolean)
andTopology.removeConnectivityListener(ConnectivityListener, boolean)
have been marked deprecatedPlease use
Topology.addConnectivityListener(ConnectivityListener, Orientation)
andTopology.removeConnectivityListener(ConnectivityListener, Orientation)
instead. -
Topology.addConnectivityListener(ConnectivityListener)
andTopology.removeConnectivityListener(ConnectivityListener)
's behaviors are changedThey now takes
Topology.getOrientation()
into account when registering/unregistering a listener. Previously, it always worked on undirected events.
Bug fix in PlainTopologySerializer:
PlainTopologySerializer.importFromString()
does not clear theTopology
anymore [issue 72]
jbotsim-icons
/io.jbotsim.ui.icons
-
A cross-shaped new icon has been added [issue 73]
jbotsim-icons
/io/jbotsim/ui/icons/plus.png
As usual, it's path can be accessed using the corresponding constant
Icons.PLUS
.
1.1.0 - 2019/09/10
Links handling clarification:
-
The
Link.Type
enum has been renamed asLink.Orientation
-
The
Link.DEFAULT_TYPE
enum has been renamed intoLink.DEFAULT_ORIENTATION
-
The
Topology
class is augmented with an instance variableorientation
that contains the default orientation of the topologyAccessors/Actuators have been added as
Topology.setOrientation()
andTopology.getOrientation()
. -
A new
Topology.isDirected()
helper method has been addedIt is a simple test of the value returned by
Topology.getOrientation()
. -
Accessors to links
Topology.getLinks()
,Topology.getLink()
andNode.getLinks()
now return links whose type is determined with respect toTopology.getOrientation()
-
Accessors to links based on a
Boolean
specification of the orientation i.e.,Topology.getLinks(boolean)
,Topology.getLink(Node,Node,boolean)
andNode.getLinks(boolean)
are marked deprecated and replaced by methods where theBoolean
is replaced by aLink.Orientation
parameter -
The method
Topology.hasDirectedLinks()
is marked as deprecated;Topology.isDirected()
should be used instead -
The implementation of
Node.getCommonLinkWith()
andNode.getNeighbors()
is changed to explicitly request undirected links -
A test suite has been added to check behaviors of
Topology.getLinks()
w.r.t. topology orientation
Bug fix in Link:
- Fixed a
NullPointerException
when callingLink.equals(null)
[issue 65]
Fix in MessageEngine:
- A call to the now deprecated
MessageEngine.setSpeed()
(nowMessageEngine.setDelay()
) method does not duplicate messages delivery anymore
Behavior modifications in MessageEngine:
-
The delay feature from the former
DelayMessageEngine
has finally been integrated in theMessageEngine
Modifying the
MessageEngine
's delay (setDelay()
) will only affect messages sent during this round and the following ones. Already queued messages retain their counters. -
A message will now be dropped if the link between its sender and destination is broken, while the message is queued
In order for a message to be delivered, a link from the sender to the destination must be present during each round, while the message is queued. If at some point the
MessageEngine
can't find such a link, the message will be dropped.Note that if
Message.retryMode
is set totrue
, theMessageEngine
will try requeue it, with a new delay. -
Concurrent messages delivery is now consistent with insertion order
When several messages between a sender and a destination are supposed to be delivered during the same round (they have possibly been queued during different rounds, but with different delays), they will now consistently be delivered according to their queuing order.
New symbols in MessageEngine:
-
The
MessageEngine.setDelay(int)
andMessageEngine.getDelay()
have been createdThese methods allow you to control the delay (in rounds) applied before actually trying to deliver a message.
-
The
MessageEngine.DELAY_INSTANT
constant has been addedThis constant sets the value of the delay use for the quickest possible delivery.
-
The
MessageEngine.DEFAULT_DELAY
constant has been addedThis constant sets the delay's default value. It actually matches
MessageEngine.DELAY_INSTANT
. -
The explicit constructors
MessageEngine(Topology)
andMessageEngine(Topology, int)
have been created- It is thus now mandatory to provide at least a
Topology
when creating aMessageEngine
. MessageEngine.setTopology(Topology)
has however been kept.- No default constructor is available. Please check that your code do not use it (reflection calls included).
- It is thus now mandatory to provide at least a
Deprecations in MessageEngine:
-
The
MessageEngine.setSpeed(int)
method has been deprecatedPlease use
MessageEngine.setDelay(int)
instead.
Since the base MessageEngine
now handles the delay feature:
-
DelayMessageEngine
has been renamed toRandomMessageEngine
jbotsim-extras-common
/io.jbotsim.contrib.messaging.DelayMessageEngine
->io.jbotsim.contrib.messaging.RandomMessageEngine
-
The
RandomMessageEngine
inherits from all delay-related improvements inMessageEngine
:- The delay applied to message delivery is now modifiable during the object's lifecycle
- Concurrent messages delivery is now consistent with insertion order
- A broken link leads to message dropping
Message.retryMode
is now taken into account
Behavior modifications in AsyncMessageEngine:
-
The average feature is now better handled and documented
In non-FIFO cases, the delay is drawn randomly according to an exponential law with average value
AsyncMessageEngine.getAverageDuration()
.In FIFO cases, the theoretical random delay is drawn the same way as for non-FIFO cases, but also taking care that the new message won't be delivered before a pre-existing one.
New symbols in AsyncMessageEngine:
-
The
AsyncMessageEngine.setAverageDuration(int)
andAsyncMessageEngine.getAverageDuration()
have been createdThese methods allow you to control the delay (in rounds) applied before actually trying to deliver a message.
-
The
AsyncMessageEngine.DEFAULT_TYPE
constant has been addedThis constant sets the default queue type value:
AsyncMessageEngine.Type.FIFO
. -
The
AsyncMessageEngine.DEFAULT_AVERAGE_DURATION
constant has been addedThis constant sets the desired average delivery duration's default value:
10
rounds. -
The explicit constructors
AsyncMessageEngine(Topology, double, Type)
andAsyncMessageEngine(Topology)
have been created
Removals in AsyncMessageEngine:
-
The explicit constructor
AsyncMessageEngine(double, Type)
has been removedPlease use
AsyncMessageEngine(Topology, double, Type)
instead.
Bug fix in JViewer:
- Fixed a truncation issue when importing a Topology via the Load Topology command [issue 60]
Behavior modifications in JViewer:
- The
JViewer
now also detects.gv
and.xdot
files as to be handled with theDotTopologySerializer
[issue 48] - The
JViewer
now detects.d6
and.g6
files as to be handled with the newGraph6TopologySerializer
[issue 28]
Behavior modifications in DotTopologySerializer:
-
DotTopologySerializer.exportToString(Topology)
is now implemented (null
was knowingly returned in the previous version)Amongst other implementation points:
- Node positions are output with the
pos = "x, y!"
syntax - The Y-coordinates are exported flipped, to be consistent with
DotTopologySerializer.importFromString()
- The exportation is done without respect to the
scale
member
- Node positions are output with the
-
By default, the
DotTopologySerializer.importFromString(Topology , String)
does not scale anymore (it formerly doubled distances).The former behavior can be achieved by either:
- using the
DotTopologySerializer(double scale, int margin, boolean reorganize)
constructor or - using
TopologyLayouts.autoscale()
.
- using the
Method symbols in DotTopologySerializer:
-
DotTopologySerializer.DEFAULT_SCALE
has been addedThe previous default scale factor was
2.0
. It is now set to1.0
. -
DotTopologySerializer.DEFAULT_MARGIN
has been addedThe default value is unchanged:
50
. -
DotTopologySerializer.DOT_FILENAME_EXTENSIONS
has been addedThis array contains known extensions for DOT files. It currently contains
"gv"
,"dot"
and"xdot"
. Please prefer the.gv
extension.
-
The replacement of the parser removes the dependency to com.paypal.digraph.digraph-parser
-
The new parser has been written from the ANTLR grammar used by digraph-parser package (actually it is the grammar given in "The definitive ANTLR 4 Reference" book by T. Parr)
-
ANTLR runtime classes are still required to run the parser
-
The parser builds a graph structure (
DotGraph
,DotNode
,DotEdge
) that is translated into a topology -
The new parser permits to distinguish directed and undirected graphs
-
A new serializer
Graph6TopologySerializer
is added tojbotsim-serialization-common
/io.jbotsim.io.format.graph6
. -
Extensions
.d6
and.g6
have been registered in client classes ofTopologySerializerFilenameMatcher
:examples.tools.JBotSimConvert
examples.tools.JBotSimViewer
io.jbotsim.ui.JViewer
- An helper method has been added in
TopologySerializerFilenameMatcher
that associates a set of filename extensions with a singleTopologySerializer
-
Some internal fixes have been provided, and unit tests added, to better match AWT's implementation regarding constructors and the alpha component
-
Color.getColor()
variants now better match their AWT counter partsJBotSim's implementations used to directly consider the provided String as a RGB value, instead of trying to get the said value from a system property.
-
General documentation effort
In order to ease behavior modifications by inheritance, JBackgroundPainter
, JLinkPainter
and JNodePainter
have
been modified so that they all expose a protected
variant of:
setColor()
: this method is called by the object when it needs to set the AWTColor
of the elementsetStroke()
: this method is called by the object when it needs to set the AWTStroke
used to draw the elementsetRenderingHints()
: this method is called by the object when it needs to set the AWTRenderingHints
used to draw the element
Overriding these methods should be fairly straightforward.
The behaviors associated to each class stay unchanged.
-
JDirectedLinkPainter
is added tojbotsim-extras-swing
/io.jbotsim.ui.painting
[issue 71]It provides arrow-tips to directed links. Its implementation uses the reusable
jbotsim-extras-common
/io.jbotsim.ui.painting.ArrowTipPathGenerator
class.
Method modifications in TopologyLayouts:
TopologyLayouts.autoscale(Topology)
is nowpublic
[issue 51]
New methods in TopologyLayouts:
-
TopologyLayouts.autoscale(Topology, AutoScaleParams)
created [issue 52]This method allows to control the scaling process more precisely than the previous default, thanks to the
AutoScaleParams
object. The parameters used with the default method are:- margin ratios:
0.1
- centering: enabled
- communication ranges scaling: enabled
- sensing ranges scaling: enabled
- margin ratios:
-
TopologyLayouts.center(Topology)
created [issue 52]This method centers the content of the
Topology
inside its boundaries (without scaling it). -
TopologyBoundaries TopologyLayouts.computeBoundaries(Topology)
created [issue 52]This method computes the boundaries of a
Topology
. These are represented byTopologyBoundaries
object, with minimum and maximum coordinates on 3 axes.
jbotsim-icons
/io.jbotsim.ui.icons
-
A new icon suitable for servers/mainframes has been added [issue 59]
jbotsim-icons
/io/jbotsim/ui/icons/server.png
As usual, it's path can be accessed using the corresponding constant
Icons.SERVER
.
- Link JSE8 javadoc from javadoc [issue 62]
- Prevent some errors in javadoc compilation by specifying UTF-8 encoding for javac and javadoc [issue 66]
- Also remove some invalid tags (i.e. <tt>) from comments [issue 66]
1.0.0 - 2019/02/28
This first official version introduces several changes. They are listed here.
The project has been split into several artifacts and published on Maven Central under the io.jbotsim
group.
For modularity, clarity and re-usability sake the project is now split into several subprojects. Each resulting artifact is published along with its source code and javadoc, making integration in IDE easier (documentation, debugging, etc.).
The initial list of artifact: jbotsim-all
, jbotsim-common
, jbotsim-core
, jbotsim-extras-common
,
jbotsim-extras-swing
, jbotsim-icons
, jbotsim-serialization-common
, jbotsim-ui-common
, jbotsim-ui-swing
.
Although Maven Central is now the preferred way to retrieve JBotSim, the former standalone jar is still available.
An strong effort has been put to separate AWT/Swing code from the rest, so that common artifacts can be used with other platforms:
- common maven artifacts can be retrieved from Maven Central;
- a common standalone jar is also available
All classes have been unified under the same package name: io.jbotsim
.
jbotsim.*
->io.jbotsim.*
jbotsimx.*
->io.jbotsim.*
Some classes have been renamed or moved to different packages. Here are listed the items that don't have a section of their own.
-
Generally, all classes have been moved due to the package names unification:
jbotsim.*
->io.jbotsim.*
jbotsimx.*
->io.jbotsim.*
-
"core" classes:
jbotsim.Clock
->io.jbotsim.core.Clock
jbotsim.ClockManager
->io.jbotsim.core.ClockManager
jbotsim.Color
->io.jbotsim.core.Color
jbotsim.DefaultClock
->io.jbotsim.core.DefaultClock
jbotsim.DefaultScheduler
->io.jbotsim.core.Scheduler
jbotsim.Link
->io.jbotsim.core.Link
jbotsim.LinkResolver
->io.jbotsim.core.LinkResolver
jbotsim.MessageEngine
->io.jbotsim.core.MessageEngine
jbotsim.Message
->io.jbotsim.core.Message
jbotsim.Node
->io.jbotsim.core.Node
jbotsim.Point
->io.jbotsim.core.Point
jbotsim._Properties
->io.jbotsim.core.Properties
[issue 22]jbotsim.Scheduler
-> xjbotsim.Topology
->io.jbotsim.core.Topology
jbotsim.event.*
->io.jbotsim.core.event.*
-
Other classes:
jbotsimx.ui.painting.DefaultBackgroundPainter
->io.jbotsim.ui.painting.JBackgroundPainter
jbotsimx.ui.painting.DefaultLinkPainter
->io.jbotsim.ui.painting.JLinkPainter
jbotsimx.ui.painting.DefaultNodePainter
->io.jbotsim.ui.painting.JNodePainter
jbotsimx.dygraph.*
->ui.jbotsim.gen.dynamic.graph.*
jbotsimx.geometry.*
->ui.jbotsim.contrib.geometry.*
jbotsimx.misc.UtilClock
-> xjbotsimx.obstacle.*
->ui.jbotsim.contrib.obstacle.*
jbotsimx.replay.*
->ui.jbotsim.gen.dynamic.trace.*
jbotsimx.Connectivity
->ui.jbotsim.contrib.algos.Connectivity
jbotsimx.Algorithms
->ui.jbotsim.contrib.algos.Algorithms
jbotsim-core
/io.jbotsim.io.FileManager
The FileManager provides unified files accessing methods (read/write). An instance of FileManager is accessible (getter/setter) in the Topology object.
The provided implementation will work on Java Desktop; specific implementation should be provided for other platforms (e.g. Android).
The Format static class has been removed and its behaviours have been pushed into several objects (TopologySerializer, TopologySerializerFilenameMatcher, FileManager):
jbotsimx.format.common.Format
-> x
The Formatter interface has been renamed to TopologySerializer. The Topology now holds a TopologySerializer (by default, a PlainTopologySerializer).
jbotsimx.format.common.Formatter
->ui.jbotsim.io.TopologySerializer
The new TopologySerializerFilenameMatcher allows to get a TopologySerializer matching specific filename patterns:
jbotsim-serialization-common
/io.jbotsim.io.format.TopologySerializerFilenameMatcher
Former implementations of Formatter have been moved and renamed accordingly:
jbotsimx.format.dot.DotFormatter
->ui.jbotsim.io.format.dot.DotTopologySerializer
jbotsimx.format.plain.PlainFormatter
->ui.jbotsim.io.format.plain.PlainTopologySerializer
jbotsimx.format.tikz.TikzFormatter
->ui.jbotsim.io.format.tikz.TikzTopologySerializer
jbotsimx.format.xml.XmlFormatter
->ui.jbotsim.io.format.xml.XmlTopologySerializer
jbotsimx.format.xml.*
->ui.jbotsim.io.format.xml.*
jbotsim-ui-common
/io.jbotsim.ui.painting.UIComponent
The UIComponent has been introduced in the jbotsim-ui-common
artifact, along with several common components used
by JBotSim's default UI implementation (provided by the jbotsim-ui-swing
artifact).
Although not required, following the same pattern for your implementation would help further implementations.
To this end, the UIComponent has been introduced to hide the real type of the graphical element. in order to facilitate user interfaces creation and re-usability.
For more details, please see the implementation of the JBackgroundPainter.paintBackground()
and its usage in
JTopology.paintComponent()
.
jbotsim-icons
/io.jbotsim.ui.icons
A specific resources module has been added to provide a limited set of extra icons. They can be browsed in the corresponding folder. [issue 26]
This module contains the io.jbotsim.ui.icons.Icons
class which provides a set of constants matching the paths of the
provided icons. [issue 46]
Some color related behaviours have been moved from Node, to Color ([issue 33], see also here).
Modifications in Color:
-
Color.getColorAt(int)
creationThis method returns a Color object supposedly stored at the provided index.
A call to this method will make sure that all Colors up to the provided are actually instantiated and return the Color object associated to the index.The sequence of generated Colors is consistent across runs.
-
Color.indexOf(Color)
creationThis method returns the index of the provided Color object if it corresponds to a Color indexed by a call to
Color.getColorAt()
. It is merely a call toColor.getIndexedColors().indexOf(Color)
. -
Color.getBasicColors()
is nowColor.getIndexedColors()
This method still returns the current state of the indexed Colors list.
-
Color.getRandomColor(Random)
creationThis method returns a Color object generated using 3 calls to the provided Random. It has been introduce to foster experiments reproducibility.
Default behaviour modification:
- The
Node
's default size has been increased from8
to10
. - New 32x32 icons are available in the
jbotsim-icons
submodule:jbotsim-icons
/io/jbotsim/ui/icons/circle-blue-32x32.png
jbotsim-icons
/io/jbotsim/ui/icons/circle-blue-ocean-32x32.png
jbotsim-ui-swing
/io/jbotsim/ui/icons/default-node-icon.png
- The default icon is now
default-node-icon.png
. It is a copy ofcircle-blue-32x32.png
. - The former default icon is still available:
jbotsim-icons
/io/jbotsim/ui/icons/circle.png
.
Removals in Node:
-
Node.setState()
andNode.getState()
have been removed [issue 41] -
Node.getIntColor()
have been removed [issue 33]Please use
Color.indexOf(Color)
in association withNode.getColor()
instead. -
Node.setIntColor()
have been removed [issue 33]Please use
Node.setColor(Color)
in association withColor.getColorAt(Integer)
instead. -
Node.setRandomColor()
have been removed [issue 33]Please use
Node.setColor()
with a color fromColor.getRandomColor()
instead.
Deprecations in Node:
- Send methods taking
Object
as a payload have been deprecated for clarity sake:-
Node.send(Node, Object)
has been deprecatedPlease use
Node.send(Node, Message)
instead. -
Node.sendAll(Node, Object)
has been deprecatedPlease use
Node.sendAll(Node, Message)
instead. -
Node.sendAll(Object)
has been deprecatedPlease use
Node.sendAll(Message)
instead.
-
New methods in Node:
-
Node.die()
has been added [issue 45]It requests the
Node
to die by the end of the round. A dead node can't be revived. -
Node.isDying()
has been added [issue 45]It tells whether the
Node
is dying (or already dead) or not.
Node methods renaming:
Node.setSize()
is nowNode.setIconSize()
[issue 39]Node.getSize()
is nowNode.getIconSize()
[issue 39]
-
Point.setLocation(double, double, double)
creation -
Point.setLocation(Point)
now also takes z component into account
-
DefaultClock
now takesClock.setTimeUnit()
into account.The default clock speed from the
Topology
is thus now applied. If you want to use it in bulk mode, you need to specifyTopology.setClockSpeed(0)
. -
Defaultclock
is now implemented with aReentrantLock
and aCondition
to wait while paused.
The command management has been moved from JTopology
to Topology
Moved interface:
jbotsimx.ui.CommandListener
-> jbotsim-core
/io.jbotsim.core.event.CommandListener
Moved methods:
-
JTopology.addCommandListener()
->Topology.addCommandListener()
-
JTopology.removeCommandListener()
->Topology.removeCommandListener()
-
JTopology.removeCommand()
->Topology.removeCommand()
-
JTopology.removeAllCommands()
->Topology.removeAllCommands()
-
JTopology.addCommand()
->Topology.addCommand()
A specific string (
Topology.COMMAND_SEPARATOR
) is provided to be used as separator. It is simply ignored for command execution.
New methods:
-
Topology.getCommands()
has been createdThis methods computes the current list of commands. It merges the commands added via
Topology.addCommand()
to a set of default commands (see Topology.DefaultCommands). The default commands can be disabled usingTopology.disableDefaultCommands()
-
Topology.disableDefaultCommands()
has been createdDisables the default commands. They are enabled by default?
-
Topology.enableDefaultCommands()
has been createdEnables the default commands. They are enabled by default?
-
Topology.executeCommand()
has been createdThis method tries to execute the provided command (as a default command) and then passes it to all
CommandListner
s.
Removal in Topology:
-
deprecated
Topology.getJTopology()
has been removed -
Topology.setLinkPainter()
has been removed (and replace byadd
/remove
/setDefault
accessors)
New methods in Topology:
-
Topology.setDefaultLinkPainter()
has been addedIt removes any previous
LinkPainter
and replace them by the provided one. -
Topology.addLinkPainter()
has been addedIt adds the provided
LinkPainter
to the internal list ofLinkPainter
s. -
Topology.removeLinkPainter()
has been addedIt removes the provided
LinkPainter
from the internal list ofLinkPainter
s.
Topology methods renaming:
Topology.setClockSpeed()
is nowTopology.setTimeUnit()
Topology.getClockSpeed()
is nowTopology.getTimeUnit()
The JConsole
has been removed:
jbotsimx.JConsole
-> x
The Scheduler
interface has been removed:
jbotsim.Scheduler
-> x
The DefaultScheduler
class has been renamed:
jbotsim.DefaultScheduler
->io.jbotsim.core.Scheduler
jbotsim-extras-common
/io.jbotsim.gen.basic.TopologyLayouts
The new Layouts
class proposes static methods which apply specific layouts to existing Nodes in a Topology.
Amongst others, the TopologyLayouts.autoscale()
static method automatically scales the provided Topology to fit its
boundaries.
The former TopologyGenerator
static class, applying specific topologies to an existing Topology
object, has been
modified:
-
jbotsimx.topology.TopologyGenerator
->jbotsim-extras-common
/ui.jbotsim.gen.basic.TopologyGenerators
-
new methods in
ui.jbotsim.gen.basic.TopologyGenerators
now also provide the (known) model name of the Node type to be instantiated.
A TopologyGenerator
interface has been created, along with a set of implementation.
These objects will add as many nodes as required to match the requirements.
The content of the new ui.jbotsim.gen.basic.generators
package is listed there after:
-
ui.jbotsim.gen.basic.generators.TopologyGenerator
creationThis is the interface providing a simple
generate()
method. -
ui.jbotsim.gen.basic.generators.AbstractGenerator
creationThis is a convenience abstract class used for actual implementations.
-
ui.jbotsim.gen.basic.generators.GridGenerator
creationThis implementation generates a grid topology.
-
ui.jbotsim.gen.basic.generators.KNGenerator
creationThis implementation generates a complete graph based on a ring topology.
-
ui.jbotsim.gen.basic.generators.LineGenerator
creationThis implementation generates a line topology.
-
ui.jbotsim.gen.basic.generators.RandomLocationsGenerator
creationThis implementation generates a randomly distributed set of nodes.
-
ui.jbotsim.gen.basic.generators.RingGenerator
creationThis implementation generates a ring topology.
-
ui.jbotsim.gen.basic.generators.TorusGenerator
creationThis implementation generates a torus topology.
MovementListener method renaming:
MovementListener.onMove()
is nowMovementListener.onMovement()
JBotSim is advancing towards the release of version 1.0. We took the opportunity of the "beta" cycle to make a number of scheduled API changes.
The main changes removed AWT & SWING dependencies of non-UI classes (in view of enabling JBotSim on other platforms like Android). Most changes impact only the "imports" in your programs + other minor changes.
Please contact us (contact@jbotsim.io) would you have some trouble migrating your code.
Main changes:
-
(import) awt.Color -> jbotsim.Color
-
(import) awt.Point2D -> jbotsim.Point
-
(import) jbotsim.Point3D -> jbotsim.Point
-
(import) jbotsim.ui -> jbotsimx.ui
-
(Topology) getDimension -> deleted (please use getWidth + getHeight directly)
-
(Topology) fromString, toString, fromFile, toFile -> moved to jbotsimx.format
-
(Node) basicColors -> moved to the new jbotsim.Color
-
(internals) DefaultClock is now a timerless thread looping without delay. You can ignore this if you are using the classical JViewer or JTopology.
-
(Topology) start() must be called explicitly once the simulation is set up
The last change is certainly the most critical, as the previous behavior of the topology was to start automatically (by default). Now, it does not start automatically, and start() must be called at the end of the simulation set up.
Note: If you want to start in a paused stated, but still want your nodes to have executed their onStart() method before that, you may simply call start() on your topology immediately followed by a call to pause(). (Eventually we will provide an atomic call to this effect.)