Skip to content

Commit c3e304c

Browse files
committed
fix formatting
1 parent 00d4268 commit c3e304c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/DynamicAssortment/DynamicAssortment.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ function DynamicAssortmentBenchmark(;
5454
d=2,
5555
K=4,
5656
max_steps=80,
57-
customer_choice_model=Chain(Dense(hcat([-0.8 0.6 -0.4], reshape([0.3 + 0.2 * (i - 1) for i in 1:d], 1, d))), vec),
57+
customer_choice_model=Chain(
58+
Dense(hcat([-0.8 0.6 -0.4], reshape([0.3 + 0.2 * (i - 1) for i in 1:d], 1, d))), vec
59+
),
5860
exogenous=false,
5961
)
6062
return DynamicAssortmentBenchmark{exogenous,typeof(customer_choice_model)}(

test/dynamic_assortment.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end
3737
# Test instance structure
3838
@test length(instance.prices) == 6 # N items + 1 no-purchase action
3939
@test instance.prices[end] == 0.0 # No-purchase action has price 0
40-
@test all(1.0 p 10.0 for p in instance.prices[1:end-1]) # Prices in [1, 10]
40+
@test all(1.0 p 10.0 for p in instance.prices[1:(end - 1)]) # Prices in [1, 10]
4141

4242
@test size(instance.features) == (3, 5) # (d, N)
4343
@test all(1.0 f 10.0 for f in instance.features) # Features in [1, 10]
@@ -67,7 +67,7 @@ end
6767

6868
# Test features structure: [prices; hype_saturation; static_features]
6969
@test size(env.features) == (5, 5) # (1 + 2 + d, N) = (1 + 2 + 2, 5)
70-
@test env.features[1, :] == instance.prices[1:end-1] # First row is prices (excluding no-purchase)
70+
@test env.features[1, :] == instance.prices[1:(end - 1)] # First row is prices (excluding no-purchase)
7171

7272
# Test utility computation
7373
@test length(env.utility) == 5 # One utility per item
@@ -100,9 +100,9 @@ end
100100

101101
# Features should be reset to initial values
102102
expected_features = vcat(
103-
reshape(instance.prices[1:end-1], 1, :),
103+
reshape(instance.prices[1:(end - 1)], 1, :),
104104
instance.starting_hype_and_saturation,
105-
instance.features
105+
instance.features,
106106
)
107107
@test env.features expected_features
108108
end
@@ -208,7 +208,7 @@ end
208208
end
209209

210210
# Test termination
211-
for _ in 1:(DAP.max_steps(env)-1)
211+
for _ in 1:(DAP.max_steps(env) - 1)
212212
if !is_terminated(env)
213213
step!(env, assortment)
214214
end

0 commit comments

Comments
 (0)