File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ namespace SimSharp {
22
22
public class ContainerGet : Event {
23
23
public double Amount { get ; protected set ; }
24
24
public DateTime Time { get ; private set ; }
25
- public Process Process { get ; private set ; }
25
+ public Process Owner { get ; set ; }
26
26
27
27
public ContainerGet ( Simulation environment , Action < Event > callback , double amount )
28
28
: base ( environment ) {
29
29
if ( amount <= 0 ) throw new ArgumentException ( "Amount must be > 0." , "amount" ) ;
30
30
Amount = amount ;
31
31
CallbackList . Add ( callback ) ;
32
32
Time = environment . Now ;
33
- Process = environment . ActiveProcess ;
33
+ Owner = environment . ActiveProcess ;
34
34
}
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ namespace SimSharp {
22
22
public class ContainerPut : Event {
23
23
public double Amount { get ; protected set ; }
24
24
public DateTime Time { get ; private set ; }
25
- public Process Process { get ; private set ; }
25
+ public Process Owner { get ; set ; }
26
26
27
27
public ContainerPut ( Simulation environment , Action < Event > callback , double amount )
28
28
: base ( environment ) {
29
29
if ( amount <= 0 ) throw new ArgumentException ( "Amount must be > 0." , "amount" ) ;
30
30
Amount = amount ;
31
31
CallbackList . Add ( callback ) ;
32
32
Time = environment . Now ;
33
- Process = environment . ActiveProcess ;
33
+ Owner = environment . ActiveProcess ;
34
34
}
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ namespace SimSharp {
22
22
public class Request : Event , IDisposable {
23
23
private readonly Action < Event > disposeCallback ;
24
24
public DateTime Time { get ; private set ; }
25
- public Process Process { get ; private set ; }
25
+ public Process Owner { get ; set ; }
26
26
27
27
public Request ( Simulation environment , Action < Event > callback , Action < Event > disposeCallback )
28
28
: base ( environment ) {
29
29
CallbackList . Add ( callback ) ;
30
30
this . disposeCallback = disposeCallback ;
31
31
Time = environment . Now ;
32
- Process = environment . ActiveProcess ;
32
+ Owner = environment . ActiveProcess ;
33
33
}
34
34
35
35
public virtual void Dispose ( ) {
Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ You should have received a copy of the GNU General Public License
21
21
namespace SimSharp {
22
22
public class StoreGet : Event {
23
23
public DateTime Time { get ; private set ; }
24
- public Process Process { get ; private set ; }
24
+ public Process Owner { get ; set ; }
25
25
26
26
public StoreGet ( Simulation environment , Action < Event > callback )
27
27
: base ( environment ) {
28
28
CallbackList . Add ( callback ) ;
29
29
Time = environment . Now ;
30
- Process = environment . ActiveProcess ;
30
+ Owner = environment . ActiveProcess ;
31
31
}
32
32
}
33
33
}
Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ You should have received a copy of the GNU General Public License
21
21
namespace SimSharp {
22
22
public class StorePut : Event {
23
23
public DateTime Time { get ; private set ; }
24
- public Process Process { get ; private set ; }
24
+ public Process Owner { get ; set ; }
25
25
26
26
public StorePut ( Simulation environment , Action < Event > callback , object value )
27
27
: base ( environment ) {
28
28
if ( value == null ) throw new ArgumentNullException ( "value" , "Value to put in a Store cannot be null." ) ;
29
29
CallbackList . Add ( callback ) ;
30
30
Value = value ;
31
31
Time = environment . Now ;
32
- Process = environment . ActiveProcess ;
32
+ Owner = environment . ActiveProcess ;
33
33
}
34
34
}
35
35
}
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ protected virtual void DoRequest(PreemptiveRequest request) {
118
118
var preempt = Users . MaxItems ( x => x ) . Last ( ) ;
119
119
if ( preempt . CompareTo ( request ) > 0 ) {
120
120
Users . Remove ( preempt ) ;
121
- preempt . Process . Interrupt ( new Preempted ( request . Process , preempt . Time ) ) ;
121
+ preempt . Owner ? . Interrupt ( new Preempted ( request . Owner , preempt . Time ) ) ;
122
122
}
123
123
}
124
124
if ( Users . Count < Capacity ) {
You can’t perform that action at this time.
0 commit comments