-
Notifications
You must be signed in to change notification settings - Fork 0
Document editor and simulation code #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,42 @@ | ||
| namespace MedWNetworkSim.App.Models; | ||
|
|
||
| /// <summary> | ||
| /// Represents a connection between two nodes, including routing attributes and optional capacity. | ||
| /// </summary> | ||
| public sealed class EdgeModel | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the unique identifier for the edge. | ||
| /// </summary> | ||
| public string Id { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the source node identifier. | ||
| /// </summary> | ||
| public string FromNodeId { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the destination node identifier. | ||
| /// </summary> | ||
| public string ToNodeId { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the time cost used when traffic prioritizes speed or total cost. | ||
| /// </summary> | ||
| public double Time { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the monetary or general routing cost used when traffic prioritizes cost or total cost. | ||
| /// </summary> | ||
| public double Cost { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the optional shared capacity of the edge. Null means unlimited capacity. | ||
| /// </summary> | ||
| public double? Capacity { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets a value indicating whether traffic can travel in both directions on this edge. | ||
| /// </summary> | ||
| public bool IsBidirectional { get; set; } = true; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,27 @@ | ||
| namespace MedWNetworkSim.App.Models; | ||
|
|
||
| /// <summary> | ||
| /// Describes how a single node participates in one traffic type. | ||
| /// </summary> | ||
| public sealed class NodeTrafficProfile | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the traffic type this profile applies to. | ||
| /// </summary> | ||
| public string TrafficType { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the amount of this traffic type produced at the node. | ||
| /// </summary> | ||
| public double Production { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the amount of this traffic type consumed at the node. | ||
| /// </summary> | ||
| public double Consumption { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets a value indicating whether this node may be used as an intermediate transhipment point. | ||
| /// </summary> | ||
| public bool CanTransship { get; set; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,22 @@ | ||
| namespace MedWNetworkSim.App.Models; | ||
|
|
||
| /// <summary> | ||
| /// Describes how a traffic type scores alternative routes. | ||
| /// </summary> | ||
| public enum RoutingPreference | ||
| { | ||
| /// <summary> | ||
| /// Prefer routes with the lowest total edge time. | ||
| /// </summary> | ||
| Speed, | ||
|
|
||
| /// <summary> | ||
| /// Prefer routes with the lowest total edge cost. | ||
| /// </summary> | ||
| Cost, | ||
|
|
||
| /// <summary> | ||
| /// Prefer routes with the lowest combined time plus cost score. | ||
| /// </summary> | ||
| TotalCost | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,27 @@ | ||
| namespace MedWNetworkSim.App.Models; | ||
|
|
||
| /// <summary> | ||
| /// Defines how one traffic type behaves when the simulator routes it through the network. | ||
| /// </summary> | ||
| public sealed class TrafficTypeDefinition | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the name of the traffic type. | ||
| /// </summary> | ||
| public string Name { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets an optional description shown in the editor. | ||
| /// </summary> | ||
| public string Description { get; set; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the route-scoring preference for this traffic type. | ||
| /// </summary> | ||
| public RoutingPreference RoutingPreference { get; set; } = RoutingPreference.TotalCost; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the optional per-unit bid used when competing for constrained edge capacity. | ||
| /// </summary> | ||
| public double? CapacityBidPerUnit { get; set; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,52 @@ | ||
| namespace MedWNetworkSim.App.Services; | ||
|
|
||
| /// <summary> | ||
| /// Summarizes the delivered movement cost seen by a consumer node for one traffic type. | ||
| /// </summary> | ||
| public sealed class ConsumerCostSummary | ||
| { | ||
| /// <summary> | ||
| /// Gets the traffic type summarized by this row. | ||
| /// </summary> | ||
| public string TrafficType { get; init; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets the consumer node identifier. | ||
| /// </summary> | ||
| public string ConsumerNodeId { get; init; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets the consumer node name. | ||
| /// </summary> | ||
| public string ConsumerName { get; init; } = string.Empty; | ||
|
|
||
| /// <summary> | ||
| /// Gets the quantity satisfied by same-node local production. | ||
| /// </summary> | ||
| public double LocalQuantity { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the average movement cost per unit for locally satisfied demand. | ||
| /// </summary> | ||
| public double LocalUnitCost { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the quantity satisfied by imported flow from other nodes. | ||
| /// </summary> | ||
| public double ImportedQuantity { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the average movement cost per unit for imported flow. | ||
| /// </summary> | ||
| public double ImportedUnitCost { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the average movement cost per unit across local and imported supply together. | ||
| /// </summary> | ||
| public double BlendedUnitCost { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the total movement cost accumulated by all delivered supply in this summary row. | ||
| /// </summary> | ||
| public double TotalMovementCost { get; init; } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The links in the 'Code Structure' section use absolute file paths specific to your local environment (e.g.,
/C:/Users/...). These links will not function correctly for other users or within the repository's hosting environment. Please use relative paths starting from the repository root.