C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
Candidate.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Runtime.Serialization;
6
8{
11 {
12 #region IAPIResource Interface Members
18 public string id
19 {
20 get => index?.ToString();
21 set
22 {
23 if (value == null)
24 {
25 index = null;
26 return;
27 }
28
29 if (!Int32.TryParse(value, out int parsedIndex))
30 throw new ArgumentException("id should be a valid integer representation.");
32 }
33 }
34
37 public string collection_name =>
38 $"{OptimizationView.CLASS_COLLECTION_NAME}/{optimization_view?.ref_id}/{Candidates.CLASS_COLLECTION_NAME}";
39
44 public string Path => API.GetResourcePath(this);
45 #endregion IAPIResource Interface Members
46
47 #region Public Properties
49 [DataMember(Order = 2)]
51
53 [DataMember(Order = 3)]
54 public int? index { get; set; }
55
57 [DataMember(Order = 20)]
59
61 private SubResource<PortfolioView> _portfolioViewEndpoint;
62
66 public SubResource<PortfolioView> portfolio_view => _portfolioViewEndpoint ??
67 (_portfolioViewEndpoint = new SubResource<PortfolioView>(this, "portfolio_view"));
68 #endregion Public Properties
69
71 protected override void AfterMembersCloned(APIType _)
72 {
73 base.AfterMembersCloned(_);
74 _portfolioViewEndpoint = null;
75 }
76 }
77}
Base class used by all types and resources.
Definition APIType.cs:8
Describes a collection of resources which can be listed.
API methods / requests made available to the user.
A candidate is a potential solution to the optimization problem.
Definition Candidate.cs:11
IReference< OptimizationView > optimization_view
The optimization view that owns this candidate.
Definition Candidate.cs:50
override void AfterMembersCloned(APIType _)
Invoked following construction if the current instance has been created using a member-wise clone of ...
Definition Candidate.cs:71
string Path
The relative path to this candidate from the root URL.
Definition Candidate.cs:44
int? index
The index identifying this candidate within an OptimizationView's candidates.
Definition Candidate.cs:54
IEnumerable< CandidateParameter > parameterization
The parameters of the layer_views that define this candidate.
Definition Candidate.cs:58
string collection_name
The collection endpoint at which this object resides on the server.
Definition Candidate.cs:37
SubResource< PortfolioView > portfolio_view
An endpoint to request the portfolio_view that describes this candidate solution.
Definition Candidate.cs:66
Object to map metrics on the initial portfolio.
Interface for Base class used by all resources.