Skip to content

Commit 00c5f90

Browse files
committed
Rename
1 parent 4e5bb04 commit 00c5f90

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Runtime/Details/SolverStats.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public interface SolverStats{
77

88
PlanningState status { get; }
99
int peak { get; }
10-
int I { get; }
10+
int iteration { get; }
1111

1212
}
1313

Runtime/Solver.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ public class Solver<T> : SolverStats where T : class{
1313
public bool brfs, safe = true;
1414
public PlanningState status { get; private set; }
1515
public int peak { get; private set; }
16-
public int I { get; private set; }
16+
public int iteration { get; private set; }
1717
T initialState;
1818
Dish<T> dish;
1919
Goal<T> goal;
2020
NodeSet<T> avail = null;
2121

2222
public bool isRunning => status == S.Running;
2323

24-
public Node<T> Next(T s, in Goal<T> goal, int iter=-1){
24+
public Node<T> Next(T s, in Goal<T> goal, int cap=-1){
2525
if(s == null) throw new NullRef(NO_INIT_ERR);
2626
dish = dish ?? Dish<T>.Create(s, safe);
2727
initialState = s;
2828
this.goal = goal;
29-
I = 0;
29+
iteration = 0;
3030
avail = new NodeSet<T>(s, goal.h, !brfs, maxNodes,
3131
tolerance);
32-
return Iterate(iter);
32+
return Iterate(cap);
3333
}
3434

35-
public Node<T> Iterate(int iter=-1){
35+
public Node<T> Iterate(int cap=-1){
3636
if(initialState == null) throw new InvOp(NO_INIT_ERR);
3737
if(status == S.MaxIterExceeded) return null;
38-
if(iter == -1) iter = maxIter;
38+
if(cap == -1) cap = maxIter;
3939
int i = 0;
40-
while(avail && i++ < iter && I++ < maxIter){
40+
while(avail && i++ < cap && iteration++ < maxIter){
4141
var current = avail.Pop();
4242
if(goal.match(current.state)){
4343
status = S.Done;
@@ -51,7 +51,7 @@ public Node<T> Iterate(int iter=-1){
5151
status = S.CapacityExceeded;
5252
}else{
5353
status = avail
54-
? (I < maxIter ? S.Running : S.MaxIterExceeded)
54+
? (iteration < maxIter ? S.Running : S.MaxIterExceeded)
5555
: S.Failed;
5656
}
5757
return null;

Tests/Editor/SolverTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ [Test] public void IsRunning_false_after_solving(){
4343
}
4444

4545
[Test] public void IsRunning_true_with_zero_frames_budget(){
46-
var z = x.Next(new Idler(), unreachable, iter: 0);
46+
var z = x.Next(new Idler(), unreachable, cap: 0);
4747
o( x.isRunning, true);
4848
}
4949

5050
[Test] public void IsRunning_true_with_remaining_frames(){
51-
var z = x.Next(new Inc(), unreachable, iter: 1);
51+
var z = x.Next(new Inc(), unreachable, cap: 1);
5252
o( x.isRunning, true);
5353
}
5454

0 commit comments

Comments
 (0)