Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions src/main/java/ca/wise/api/input/GustingOptions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package ca.wise.api.input;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
* Options that define how and if wind gusting is applied to a scenario.
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GustingOptions {

@Getter @Setter
private Gusting gusting;

/**
* Must be available for time derived gusting.
*/
@Getter @Setter
private Integer gustsPerHour;

/**
* Must be available for average, time derived, and ROS derived gusting.
* For average gusting this is a weighted averaging of wind speed and gusting. ws = ((100-percentGusting)*ws + percentGusting*gust)/100.
* For time derived gusting gusts will occur for (3600/gustPerHour*(percentGusting*100)) seconds per gust.
* For ROS derived gusting gusts will occur for (3600*(percentGusting/100)) seconds per hour.
*/
@Getter @Setter
private Double percentGusting;

/**
* Must be present for time and ROS derived gusting. Middle is not valid for ROS derived gusting.
*/
@Getter @Setter
private GustBias gustBias;

public enum Gusting {
NO_GUSTING(0),
AVERAGE_GUSTING(1),
TIME_DERIVED_GUSTING(2),
ROS_DERIVED_GUSTING(3);

public final int value;

Gusting(int value) {
this.value = value;
}

public static Gusting fromInt(int value) {
Gusting[] gusts = values();
for (int i = 0; i < gusts.length; i++) {
if (gusts[i].value == value)
return gusts[i];
}
return NO_GUSTING;
}
}

public enum GustBias{
MIDDLE(0),
START(1),
END(2);

public final int value;

GustBias(int value) {
this.value = value;
}

public static GustBias fromInt(int value) {
GustBias[] gusts = values();
for (int i = 0; i < gusts.length; i++) {
if (gusts[i].value == value)
return gusts[i];
}
return START;
}
}
}
6 changes: 6 additions & 0 deletions src/main/java/ca/wise/api/input/Scenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ public void setName(String value) {

@Getter @Setter
private StopModellingOptions stopModellingOptions;

/**
* Options for enabling wind gusts if available in the weather stream.
*/
@Getter @Setter
private GustingOptions gustingOptions;

/**
* Add a new burning condition.
Expand Down