Skip to main content
Tweeted twitter.com/StackCodeReview/status/1452832369099091973
added 22 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Java: Discrete Event Simulator

In particular for the 3rd point, I have two dilemma(s):

1)About the link between class responsibilities and what is the best way of invoking a method call between different objects in different scopes.

  1. About the link between class responsibilities and what is the best way of invoking a method call between different objects in different scopes.

EventManager is deemed to be in charge of holding a Statistics field, and holding a PriorityQueue of Events, since it's the Manager. In my implementation I could have written one of the following:

On the other hand, in B feels like its more fulfilling to responsibility. The object newEventnewEvent is the provider of the information, hence should be placed in the arguments.

I chose A in the end as during the time I found B logical, I realised I have to do ugly dispatching and I am tempted to pass back statistics as arguments to Events, in the form of newEvent.f(this)newEvent.f(this), in Statistics method updateStatisticsupdateStatistics. This just defeats my purpose of sending EventsEvents in as arguments from the start. What is your view on this dilemma of responsibility design vs the ease of coding to the programmer?

Java: Discrete Event Simulator

In particular for the 3rd point, I have two dilemma(s)

1)About the link between class responsibilities and what is the best way of invoking a method call between different objects in different scopes.

EventManager is deemed to be in charge of holding a Statistics field, and holding a PriorityQueue of Events, since it's the Manager. In my implementation I could have written one of the following

On the other hand, in B feels like its more fulfilling to responsibility. The object newEvent is the provider of the information, hence should be placed in the arguments.

I chose A in the end as during the time I found B logical, I realised I have to do ugly dispatching and I am tempted to pass back statistics as arguments to Events, in the form of newEvent.f(this), in Statistics method updateStatistics. This just defeats my purpose of sending Events in as arguments from the start. What is your view on this dilemma of responsibility design vs the ease of coding to the programmer?

Discrete Event Simulator

In particular for the 3rd point, I have two dilemma(s):

  1. About the link between class responsibilities and what is the best way of invoking a method call between different objects in different scopes.

EventManager is deemed to be in charge of holding a Statistics field, and holding a PriorityQueue of Events, since it's the Manager. In my implementation I could have written one of the following:

On the other hand, in B feels like its more fulfilling to responsibility. The object newEvent is the provider of the information, hence should be placed in the arguments.

I chose A in the end as during the time I found B logical, I realised I have to do ugly dispatching and I am tempted to pass back statistics as arguments to Events, in the form of newEvent.f(this), in Statistics method updateStatistics. This just defeats my purpose of sending Events in as arguments from the start. What is your view on this dilemma of responsibility design vs the ease of coding to the programmer?

deleted 2 characters in body
Source Link

In particular for the 3rd point, I have the 2two dilemma(s)

In particular for the 3rd point, I have the 2 dilemma(s)

In particular for the 3rd point, I have two dilemma(s)

added 3 characters in body
Source Link

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic guideoverview.

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic guide.

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview.

Prompted questions in own design
Source Link
Loading
Clarified question
Source Link
Loading
Increase tags
Link
Loading
Added comments in terms of javadocs and updated code
Source Link
Loading
deleted 225 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
deleted 2 characters in body
Source Link
Loading
edited title
Link
Loading
added 567 characters in body
Source Link
Loading
added 859 characters in body
Source Link
Loading
Source Link
Loading