Skip to content
Snippets Groups Projects
Commit 07d88f92 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

Merge origin/master

parents c463af89 6a411629
No related branches found
No related tags found
No related merge requests found
## Homework 3: Example Simulation Recording using OpenDIS Network Streams
<!-- Viewable at https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/src/MV3500Cohort2024JulySeptember/homework3/README.md -->
### Assignment
1. Adapt the functionality for [OpenDIS ExampleSimulationProgram](../../../../examples/src/OpenDis7Examples/ExampleSimulationProgram.java), modifying provided code
2. Experiment with the enumeration values that set up each entity and PDU. What works for you? What makes sense for your future work?
3. Adapt or replace the UML diagrams to describe what you have going on.
4. Record, save and replay your result stream using [PduRecorder](https://savage.nps.edu/opendis7-java/javadoc/edu/nps/moves/dis7/utilities/stream/PduRecorder.html) or [Wireshark](https://www.wireshark.org)
* see local [assignments/src/pduLog](../../../pduLog) subdirectory for latest opendis log files
* Coming soon, we will also (again have) [X3D-Edit](https://savage.nps.edu/X3D-Edit) for DIS stream recording/replay
5. Observe good-practice conventions in the [assignments README](../../../README.md) and [current-course README](../README.md) instructions.
This assignment presents a Problem Prototyping opportunity.
While some minimal functionality is expected, the general outline of
a networking problem and proposed solution holds great interest.
Think of it as warmup preparation for your future work.
This is also a freeplay opportunity.
You have the option to pick one or more of the provided course example programs
and adapt the source to demonstrate a new client-server handshake protocol of interest.
Be sure to provide a rationale that justifies why the networking choices you made
(TCP/UDP, unicast/multicast, etc.) are the best for the problem you are addressing.
You may find that the prior [homework2 README](../homework2/README.md) still provides
helpful details on what specific deliverables are expected in each homework assignment.
Team efforts are encouraged, though if you choose a team approach be sure to justify why.
This is a good warmup prior to final projects. Have fun with Java networking!
### Prior Assignment, August 2019
In 2019, students worked together on a single project to check wireless multicast connectivity recently deployed on NPS campus.
See their experimental results in the [NPS Multicast Connectivity Report](../../MV3500Cohort2019JulySeptember/homework3).
This program runs a simulation between two entites. One entity is initialized at
(0,0,0) and the other is randomly placed. The hunter entity moves towards the prey
entity until it is in range. When in range the hunter attempts to shoot the prey.
If successful, the simulation ends. The prey entity constantly attemps to move away
from the hunter.
\ No newline at end of file
......@@ -21,9 +21,7 @@ import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/** The purpose of this inheritable class is to provide an easily modifiable
* example simulation program that includes DIS-capable entities performing
* tasks of interest, and then reporting activity via PDUs to the network.
/** Modification of the example program; a simple user interactive simulation of navigating a minefield.
* Default program initialization includes PDU recording turned on by default.
* @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramLog.txt" target="_blank">ExampleSimulationProgramLog.txt</a>
* @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramPduCaptureLog.dislog" target="_blank">ExampleSimulationProgramPduCaptureLog.dislog</a>
......
## Homework 3: Example Simulation Recording using OpenDIS Network Streams
<!-- Viewable at https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/src/MV3500Cohort2024JulySeptember/homework3/README.md -->
### Assignment
1. Adapt the functionality for [OpenDIS ExampleSimulationProgram](../../../../examples/src/OpenDis7Examples/ExampleSimulationProgram.java), modifying provided code
2. Experiment with the enumeration values that set up each entity and PDU. What works for you? What makes sense for your future work?
I added movement to the simulation.
3. Adapt or replace the UML diagrams to describe what you have going on.
4. Record, save and replay your result stream using [PduRecorder](https://savage.nps.edu/opendis7-java/javadoc/edu/nps/moves/dis7/utilities/stream/PduRecorder.html) or [Wireshark](https://www.wireshark.org)
* see local [assignments/src/pduLog](../../../pduLog) subdirectory for latest opendis log files
* Coming soon, we will also (again have) [X3D-Edit](https://savage.nps.edu/X3D-Edit) for DIS stream recording/replay
5. Observe good-practice conventions in the [assignments README](../../../README.md) and [current-course README](../README.md) instructions.
This assignment presents a Problem Prototyping opportunity.
While some minimal functionality is expected, the general outline of
a networking problem and proposed solution holds great interest.
Think of it as warmup preparation for your future work.
For assignment 3 I implemented random movement.
/**
* Final project assignments supporting the NPS MOVES MV3500 Networked Graphics course.
*
* @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments" target="_blank">networkedGraphicsMV3500 assignments</a>
* @see java.lang.Package
* @see <a href="https://stackoverflow.com/questions/22095487/why-is-package-info-java-useful" target="_blank">StackOverflow: why-is-package-info-java-useful</a>
* @see <a href="https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java" target="_blank">StackOverflow: how-do-i-document-packages-in-java</a>
*/
package MV3500Cohort2024JulySeptember.homework3.Matiski;
......@@ -17,7 +17,7 @@ public class ExampleSimulationProgram {
// Constants for the Battleship game
private static final int GRID_SIZE = 10; // 10x10 grid for Battleship
private static final int MAX_TURNS = 100; // Limit turns to avoid infinite games
private static final int MAX_TURNS = 200; // Limit turns to avoid infinite games
// Grids for each player
private char[][] player1Grid = new char[GRID_SIZE][GRID_SIZE];
......@@ -32,11 +32,29 @@ public class ExampleSimulationProgram {
// DIS utilities
private String descriptor = this.getClass().getSimpleName();
/**
* DIS Channel to output to
*/
protected DisChannel disChannel;
protected PduFactory pduFactory;
protected CommentPdu gridStatusPdu;
protected FirePdu firePduPlayer1;
protected FirePdu firePduPlayer2;
/**
* PDU generator
*/
protected PduFactory pduFactory; //
/**
* Grid Status updating PDU
*/
protected CommentPdu gridStatusPdu; //
/**
* Player 1 PDU
*/
protected FirePdu firePduPlayer1; //
/**
* Player 2 PDU
*/
protected FirePdu firePduPlayer2; //
/**
* Munition Descriptor
*/
protected MunitionDescriptor munitionDescriptor1 = new MunitionDescriptor();
// Simulation time settings
......
......@@ -4,6 +4,7 @@
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Networked Graphics MV3500 examples</name>
<explicit-platform explicit-source-supported="true"/>
<source-roots>
<root id="src.dir"/>
<root id="src.src.dir"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment