Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.ExtLibs/HeuristicLab.SimSharp/3.3.1/SimSharp-3.3.1/Collections/GenericPriorityQueueNode.cs @ 17495

Last change on this file since 17495 was 17487, checked in by abeham, 5 years ago

#3065: update Sim# to 3.3.1

File size: 2.3 KB
Line 
1#region License
2/*
3The MIT License (MIT)
4
5Copyright (c) 2013 Daniel "BlueRaja" Pflughoeft
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in
15all copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23THE SOFTWARE.
24 */
25#endregion
26
27namespace SimSharp {
28
29  /// <summary>
30  /// A node class for the generic priority queue
31  /// </summary>
32  public class GenericPriorityQueueNode {
33    /// <summary>
34    /// Represents the current position in the queue
35    /// </summary>
36    public int QueueIndex { get; internal set; }
37
38    /// <summary>
39    /// Represents the order the node was inserted in
40    /// </summary>
41    public long InsertionIndex { get; internal set; }
42  }
43
44  /// <summary>
45  /// A node class for the generic priority queue with an explicit priority type
46  /// </summary>
47  /// <remarks>
48  /// Original sources from https://github.com/BlueRaja/High-Speed-Priority-Queue-for-C-Sharp
49  /// </remarks>
50  /// <typeparam name="TPriority"></typeparam>
51  public class GenericPriorityQueueNode<TPriority> : GenericPriorityQueueNode {
52    /// <summary>
53    /// The Priority to insert this node at.  Must be set BEFORE adding a node to the queue (ideally just once, in the node's constructor).
54    /// Should not be manually edited once the node has been enqueued - use queue.UpdatePriority() instead
55    /// </summary>
56    public TPriority Priority { get; protected internal set; }
57  }
58}
Note: See TracBrowser for help on using the repository browser.