Authors:

Gilad Ivry

Mattan Margalith

Niv Saar

Alex Surguch

Table of Contents

1. Introduction

1.1 Vision 3

1.2 Problem Domain 4

1.3 Stakeholders 4

1.4 Software Context 5

1.5 System interfaces 7

2. Functional Requirments 8

3. Non Functional Requirments 10

4. Usage Scenarios

4.1 User profile 11

4.2 Use-Cases 12

4.3 Special usage considerations 18

5. Appendices 19

1.  USE CASES:

Uses cases description

Use case ID: 1

Use case name: configure simulation properties

Primary actors: User

Description: The user will configure all the properties and input all the necessary initial data that are needed in order to run the simulation.

Trigger: The user will ask to configure new simulation.

Pre-conditions: None

Post-conditions: The new system configuration has been saved in the DB and the simulator is initialized with all the inserted data.

Flow of events:

1.  The user chooses the amount of simulated entities that will participate in the simulation.

2.  The user chooses the general statistics for the simulated entities.

3.  The user chooses how to arrange the simulated entities in the map.

4.  The user chooses how the simulated entities will move on the map.

5.  The user chooses the length of the simulation (number of ticks) and the duration of each tick in hours.

6.  The user configures the special events.

7.  The user configures how to generate the requests.

8.  The user chooses the algorithms that he wants the simulation to work with.

Alternative flows: User can return to the previous step in the wizard

Sequence Diagram:

Use case ID: 2

Use case name: run the simulation

Primary actors: User

Description: The user will activate the simulation

Trigger: User presses the run simulation button.

Pre-conditions: a configuration for the simulation has been loaded.

Post-conditions: all the data from the simulation is saved in the DB and displayed for the user

Flow of events:

1.  User presses the start simulation button.

Alternative flows: None.

Sequence Diagram:

Use case ID: 3

Use case name: pause/resume the simulation

Primary actors: User

Description: The user pause/resume the simulation

Trigger: User presses the pause/resume simulation button.

Pre-conditions: The simulation is running.

Post-conditions: The simulation stops/continues to run.

Flow of events:

1.  User presses the pause simulation button.

Alternative flows: None.

Sequence Diagram:

Use case ID: 4

Use case name: end the simulation

Primary actors: User

Description: The user ask to end the simulation before the configured period of the simulation ends

Trigger: User presses the end simulation button.

Pre-conditions: The simulation is running.

Post-conditions: The simulation moves to the summery page and displays all the collected data

Flow of events:

1.  User presses the end simulation button.

Alternative flows: None.

Sequence Diagram:

Use case ID: 5

Use case name: Show graph

Primary actors: User

Description: The user asks to show him a specific graph during the simulation or in the summery stage.

Trigger: User presses on one of the tabs which represent a statistic expressed by graphs.

Pre-conditions: The simulation is running.

Post-conditions: The system displays the requested graph.

Flow of events:

1.  User chooses a display tab that contains some type of statistics.

2.  User chooses one graph from the graphs available in this tab.

3.  System displays the graph (meanwhile the simulation keeps running)

4.  User closes the display of the graph.

Alternative flows: None.

Sequence Diagram:

Use case ID: 6

Use case name: select group of simulated entities.

Primary actors: User

Description: The user selects a group of simulated entities from the map.

Trigger: User marks the simulated entities with the mouse.

Pre-conditions: The simulation is running.

Post-conditions: The system displays statistical data on the selected group.

Flow of events:

1.  User marks a group of simulated entities with the mouse.

2.  System displays a panel with statistical data on the selected group (meanwhile the simulation keeps running)

3.  User closes the display of the panel.

Alternative flows: None.

Sequence Diagram:

Special usage considerations

The user should be familiar with the algorithms and have the knowledge of how to configure and insert new ones according to the system constraints.

2.  DATA MODEL

2.1 Description of Data Objects

Group – simulates a group of users, all of which have similar characteristics.

This class enables us to gather specific statistics over the class domain, this object contains information about the number of the users in the group, and the probability to request and respond to a request, etc. Each group has a unique ID.

Event – The event data object defines a period of time, in which several parameters are altered. The event has a time and a Location, and changes the way that the users move and ask questions. The event is unified by a begin-time and end-time with a consideration of the location.

Request – A request is a user-generated data object that is generated by a RequestFactory in accordance to a unique statistical formula. The request is handled by the system manager, which directs it to the appropriate users (chosen by their location), with the aid of a selection algorithm. Each request has a unique ID.

Reply – A reply is a user-generated data object that is generated by a the system. Once a user is chosen by the selection algorithm and receives a request, a probabilistic formula is applied to decide whether to reply. If so, a reply is generated, and several parameters are updated accordingly. Each reply is identified by the request idea and the replying user's ID.

Statistical Data – This data object contains dynamic data sets, which contains all the data gathered during a simulation per user. This object contains the initial statistical data for the users belonging to a specific group. This object is initialized with X and Y parameters, which represents the probability to request and reply to a request, and with satisfactory rate, and some other client-defined parameters. The data is altered during the simulation run.

User – The main data object. Each user belongs to a specific group and has a unique ID. During the simulation the user request, reply, move, and manufacture that statistical data which we collect. The user's actions during a specific time stamp, will affect the way that this user will act in the next time stamp.

Map - This object is a large grid that represents the simulator's world domain, over which the users act during the simulation.

2.2  Data Object Relationship

2.3  Data Bases:

2.3.1  ERD:

2.3.2 Relational Tables scheme

Simulation Configuration Tables:
1. Run Configuration: runID, numOfTicks, hoursPerTick, numOfNotActiveUsers,selectionAlgo, incentivesAlgo, reqestType, spreadType, moveType
2. Users Group: runID, groupID, numOfUsers, userPoicyType, maxTimeToReply
3. User Statistical Data: runID, groupID, satisfaction, probToAns (respondX), probToSend (requestX), repliesLimit, requestDelta, replyDelta.
4. User Policy: runID, groupID, policyType, arg1 (L), arg2(alpha), arg3(beta
5. Request Modifier: runID, groupID, requestModifierType, arg1, arg2, arg3
6. Reply Modifier: runID, groupID, replyModifierType, arg1, arg2, arg3
7. Selection Algorithm: runID, selectionAlgoType, arg1, arg2, arg3

8. Incentives Algorithm: runID, incentivesAlgoType, arg1, arg2, arg3
9. Request Configuration: runID, requetType, arg1, arg2
10. Spread Configuration: runID, spreadType, arg1, arg2
11. Spread Locations: runID, locationID, numOfUsers, Coordinate
12. Movement Configuration: runID, moveType, arg1, arg2
13. Map Configuration: runID, topLeftCoordinate, downRightCoordinate
14. Events: runID, eventID, beginTime, endTime, coordinate, radios, encourageRequest, encourageRequestLocation, encourageMovement
Simulation Run Tables:
1. User Locations: runID, stepNum, groupID,userID, oldCoordinate, newCoordinate
2. User Satisfaction: runID, stepNum, groupID,userID, oldSatisfaction, newSatisfaction
3. User ProbToAns: runID, stepNum, groupID,userID, oldProbToAns, newProbToAns
4. User ProbToSend: runID, stepNum, groupID,userID, oldProbToSend, newProbToSend
5. User Requests: runID, stepNum, requestID, requestUserID, Coordinate
6. User Replies: runID, stepNum, requestID, replyUserID, Coordinate

2.3.2  Relational Tables description

Run Configuration:

-  runID: INT NOT NULL AUTO_INCREMENT – Unique primary key identifies the simulation.

-  numOfTicks: INT NOT NULL DEFAULT 1 – number of time stamps that the simulation will run.

-  hoursPerTick: INT NOT NULL DEFAULT 1 – the amount of hours each time stamp represent.

-  numOfUsers: INT NOT NULL DEFAULT 0 – total number of active users in the simulation.

-  numOfNotActiveUsers: INT NOT NULL DEFAULT 0 – total number of non-active users in the simulation.

-  selectionAlgo: VARCHAR(256) NOT NULL – the type of the selection algorithm.

-  incentivesAlgo: VARCHAR(256) NOT NULL – the type of the incentives algorithm.

-  reqestType: VARCHAR(256) NOT NULL – the type of the requests generator.

-  spreadType: VARCHAR(256) NOT NULL – the type of the users spread generator.

-  moveType: VARCHAR(256) NOT NULL – the type of the users movement generator.

Users Group:

-  runID: INT NOT NULL – foreign key to the Run Configuration table.

-  groupID: INT NOT NULL – primary key identifies the group.

-  numOfUsers: INT NOT NULL DEFAULT 1 – number of users in the group.

-  userPoicyType: VARCHAR(256) NOT NULL – type of user policy that the users belonging to the group will use.

User Statistical Data:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  groupID: INT NOT NULL – foreign key to the Users Group table.

-  satisfaction: DOUBLE NOT NULL – start satisfaction for the users in the group.

-  probToAns: DOUBLE NOT NULL – start probability to answer a request for the users in the group.

-  probToSend: DOUBLE NOT NULL - start probability to send a request for the users in the group.

-  repliesLimit: INT NOT NULL – maximum number of replies for the users in the group.

-  requestDelta: INT NOT NULL – number of time stamps that the users remembers the requests he sent.

-  replyDelta: INT NOT NULL - number of time stamps that the users remembers the replies he sent.

-  maxTimeToReply: INT NOT NULL DEFAULT 1 – maximum time in hours that the user has to replies a request.

User Policy:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  groupID: INT NOT NULL - foreign key to the Users Group table.

-  policyType: VARCHAR(256) NOT NULL - type of user policy that the users belonging to the group will use.

-  arg1: VARCHAR(256) – argument for the policy in use.

-  arg2: VARCHAR(256) – argument for the policy in use.

-  arg3: VARCHAR(256) – argument for the policy in use.

-  arg4: VARCHAR(256) – argument for the policy in use.

Request Modifier:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  groupID: INT NOT NULL - foreign key to the Users Group table.

-  requestModifierType: VARCHAR(256) NOT NULL - type of user modifier for outgoing requests that the users belonging to the group will use.

-  arg1: VARCHAR(256) – argument for the modifier in use.

-  arg2: VARCHAR(256) – argument for the modifier in use.

-  arg3: VARCHAR(256) – argument for the modifier in use.

Reply Modifier:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  groupID: INT NOT NULL - foreign key to the Users Group table.

-  replyModifierType: VARCHAR(256) NOT NULL - type of user modifier for incoming replies that the users belonging to the group will use.

-  arg1: VARCHAR(256) – argument for the modifier in use.

-  arg2: VARCHAR(256) – argument for the modifier in use.

-  arg3: VARCHAR(256) – argument for the modifier in use.

Selection Algorithm:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  selectionAlgoType: VARCHAR(256) NOT NULL - type of the selection algorithm that will be used in the simulation.

-  arg1: VARCHAR(256) – argument for the algorithm in use.

-  arg2: VARCHAR(256) – argument for the algorithm in use.

-  arg3: VARCHAR(256) – argument for the algorithm in use.

Incentives Algorithm:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  IncentivesAlgoType: VARCHAR(256) NOT NULL - type of the incentives algorithm that will be used in the simulation.

-  arg1: VARCHAR(256) – argument for the algorithm in use.

-  arg2: VARCHAR(256) – argument for the algorithm in use.

-  arg3: VARCHAR(256) – argument for the algorithm in use.

Request Configuration:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  requetType: VARCHAR(256) NOT NULL - type of the users requests generator that will be used in the simulation.

-  arg1: VARCHAR(256) – argument for the generator in use.

-  arg2: VARCHAR(256) – argument for the generator in use.

-  arg3: VARCHAR(256) – argument for the generator in use.

Spread Configuration:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  spreadType: VARCHAR(256) NOT NULL - type of the users spread generator that will be used in the simulation.

-  arg1: VARCHAR(256) – argument for the generator in use.

-  arg2: VARCHAR(256) – argument for the generator in use.

-  arg3: VARCHAR(256) – argument for the generator in use.

Movement Configuration:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  moveType: VARCHAR(256) NOT NULL - type of the users movement generator that will be used in the simulation.

-  arg1: VARCHAR(256) – argument for the generator in use.

-  arg2: VARCHAR(256) – argument for the generator in use.

-  arg3: VARCHAR(256) – argument for the generator in use.

Map Configuration:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  downLeftCoordinate: VARCHAR(256) – down left coordinate of the map.

-  topRightCoordinate: VARCHAR(256) – top right coordinate of the map.

Events:

-  runID: INT NOT NULL - foreign key to the Run Configuration table.

-  eventID: INT NOT NULL - primary key identifies the event.

-  beginTime: INT NOT NULL – the beginning time of the event.

-  endTime: INT NOT NULL – the ending time of the event.

-  coordinate: VARCHAR(256) – the location of the event.

-  radios: INT NOT NULL – the radios that the event will influence.

-  encourageRequest: DOUBLE NOT NULL – the percent that will be added to the probability to send a request.