C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
SimulationOptions.cs
Go to the documentation of this file.
1using System;
3
4namespace AnalyzeRe.Metrics
5{
9 public class SimulationOptions : APIType, IEquatable<SimulationOptions>
10 {
13
14 #region Public Properties
17 public Perspective perspective { get; set; }
18
21 public string filter { get; set; }
22
25 public bool? secondary_uncertainty { get; set; }
26
29 public ReportingPeriod reporting_period { get; set; } = new ReportingPeriod();
30 #endregion Public Properties
31
32 #region Constructors
42 public SimulationOptions(Perspective perspective = null, string filter = null,
44 {
45 this.perspective = perspective;
46 this.filter = filter;
47 this.secondary_uncertainty = secondary_uncertainty;
48 this.reporting_period = reporting_period;
49 }
50
54 {
55 if (toCopy == null) return;
56 perspective = toCopy.perspective;
57 filter = toCopy.filter;
60 }
61 #endregion Constructors
62
63 #region Public Methods
77
83 public bool Equals(SimulationOptions other)
84 {
85 return BothNullOrEqual(perspective, other.perspective) &&
86 BothNullOrEqual(filter, other.filter) &&
87 BothNullOrEqual(secondary_uncertainty, other.secondary_uncertainty) &&
88 BothNullOrEqual(reporting_period, other.reporting_period);
89 }
90 #endregion Public Methods
91
92 #region Protected Methods
94 protected bool BothNullOrEqual<T>(T first, T second) where T : class
95 {
96 return first?.Equals(second) ?? second == null;
97 }
98
100 protected bool BothNullOrEqual<T>(T? first, T? second) where T : struct
101 {
102 return first?.Equals(second) ?? second == null;
103 }
104 #endregion Protected Methods
105 }
106}
Base class used by all types and resources.
Definition APIType.cs:8
API methods / requests made available to the user.
static readonly string DateTimeFormat
The format used when transmitting DateTime information to Analyze Re servers.
Optional parameters which can be specified for all aggregated simulation result requests.
The common components of the context returned from any metrics request, indicating what parameters we...
Definition Context.cs:10
DateTime? reporting_period_begin
The reporting period starting DateTime (if it was set), which restricts results to only include losse...
Definition Context.cs:37
bool secondary_uncertainty
Whether or not to simulate using secondary uncertainty (if available). This is set to false only if s...
Definition Context.cs:32
Perspective perspective
The loss perspective determining which outputs are included in the loss distribution.
Definition Context.cs:14
DateTime? reporting_period_end
The reporting period ending DateTime (if it was set), which restricts results to only include losses ...
Definition Context.cs:42
string filter
The name of the predefined filter used to determine which event losses are included in the resulting ...
Definition Context.cs:19
A reporting period which dictates optional begin and end dates to constrain what event losses are inc...
DateTime? end
(Optional) The exclusive end date of the reporting period. If specified, event losses occurring on or...
DateTime? begin
(Optional) The inclusive start date of the reporting period. If specified, event losses occurring bef...
Optional parameters which can be specified for all simulation result requests. Includes a variety of ...
SimulationOptions(SimulationOptions toCopy)
Construct a new set of SimulationOptions from another.
bool Equals(SimulationOptions other)
Indicates whether the current object is equal to another object of the same type.
static AggregationOptions Default
The default simulation request options used when none are specified.
ReportingPeriod reporting_period
A reporting period which dictates optional begin and end dates to constrain what event losses are inc...
Perspective perspective
The requested Perspective, which determines which factors are included in the loss distribution.
SimulationOptions(Perspective perspective=null, string filter=null, bool? secondary_uncertainty=null, ReportingPeriod reporting_period=null)
Configure one or more optional simulation request parameters.
string filter
The name of the predefined filter used to determine which event losses are included in the resulting ...
bool? secondary_uncertainty
Whether or not to simulate using secondary uncertainty (if available). Set this to false to explicitl...
bool BothNullOrEqual< T >(T first, T second)
Helper method to determine if two classes are equal, or both null.
virtual RequestParameters GetParameters()
Convert this i into a set of REST request parameters.
The loss perspective determines what factors to include when computing a distribution.
override string ToString()
Perspective string is just the class name.
Helper class which makes it easier to build a set of request parameters.
RequestParameters AddQueryParameter(string name, string value)
Adds the specified name/value pair as a new request parameter with the type ParameterType....