Skip to content

Commit

Permalink
Add support for learning of MCDA weights, sensitivity analysis of MCD…
Browse files Browse the repository at this point in the history
…A weights, manually choosing weights
  • Loading branch information
salmma authored Mar 31, 2022
1 parent e7287c8 commit d890537
Show file tree
Hide file tree
Showing 18 changed files with 1,085 additions and 111 deletions.
3 changes: 3 additions & 0 deletions generated/api-nisq/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { AnalysisJobListDto } from './models/analysis-job-list-dto';
export { AnalysisResultDto } from './models/analysis-result-dto';
export { AnalysisResultListDto } from './models/analysis-result-list-dto';
export { CollectionModelEntityModelMcdaJob } from './models/collection-model-entity-model-mcda-job';
export { CollectionModelEntityModelMcdaSensitivityAnalysisJob } from './models/collection-model-entity-model-mcda-sensitivity-analysis-job';
export { CompilationJobDto } from './models/compilation-job-dto';
export { CompilationJobListDto } from './models/compilation-job-list-dto';
export { CompilerAnalysisResultDto } from './models/compiler-analysis-result-dto';
Expand All @@ -14,6 +15,8 @@ export { Description } from './models/description';
export { Element } from './models/element';
export { EntityModelCriterionValue } from './models/entity-model-criterion-value';
export { EntityModelMcdaJob } from './models/entity-model-mcda-job';
export { EntityModelMcdaSensitivityAnalysisJob } from './models/entity-model-mcda-sensitivity-analysis-job';
export { EntityModelMcdaWeightLearningJob } from './models/entity-model-mcda-weight-learning-job';
export { ExecuteAnalysisResultRequestDto } from './models/execute-analysis-result-request-dto';
export { ExecutionResultDto } from './models/execution-result-dto';
export { ExecutionResultListDto } from './models/execution-result-list-dto';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* tslint:disable */
import { EntityModelMcdaSensitivityAnalysisJob } from './entity-model-mcda-sensitivity-analysis-job';
import { Links } from './links';
export type CollectionModelEntityModelMcdaSensitivityAnalysisJob = {
_embedded?: {
mcdaSensitivityAnalysisJobs?: Array<EntityModelMcdaSensitivityAnalysisJob>;
};
_links?: Links;
};
1 change: 1 addition & 0 deletions generated/api-nisq/models/entity-model-mcda-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type EntityModelMcdaJob = {
ready?: boolean;
method?: string;
state?: string;
useBordaCount?: boolean;
jobId?: string;
jobType?: 'ANALYSIS' | 'COMPILATION' | 'QPU_SELECTION' | 'MCDA';
rankedResults?: Array<McdaResult>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* tslint:disable */
import { Links } from './links';
import { McdaResult } from './mcda-result';
export type EntityModelMcdaSensitivityAnalysisJob = {
id?: string;
time?: string;
ready?: boolean;
method?: string;
state?: string;
useBordaCount?: boolean;
jobId?: string;
jobType?: 'ANALYSIS' | 'COMPILATION' | 'QPU_SELECTION' | 'MCDA';
stepSize?: number;
upperBound?: number;
lowerBound?: number;
plotFileLocation?: string;
originalRanking?: Array<McdaResult>;
_links?: Links;
};
11 changes: 11 additions & 0 deletions generated/api-nisq/models/entity-model-mcda-weight-learning-job.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* tslint:disable */
import { Links } from './links';
export type EntityModelMcdaWeightLearningJob = {
id?: string;
time?: string;
ready?: boolean;
mcdaMethod?: string;
weightLearningMethod?: string;
state?: string;
_links?: Links;
};
112 changes: 62 additions & 50 deletions generated/api-nisq/services/root.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,59 @@ export class RootService extends BaseService {
);
}

/**
* Path part for operation getCompilers
*/
static readonly GetCompilersPath = '/compilers';

/**
* Retrieve compilers
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `getCompilers()` instead.
*
* This method doesn't expect any request body.
*/
getCompilers$Response(params: {
provider: string;
}): Observable<StrictHttpResponse<Array<string>>> {
const rb = new RequestBuilder(
this.rootUrl,
RootService.GetCompilersPath,
'get'
);
if (params) {
rb.query('provider', params.provider, {});
}
return this.http
.request(
rb.build({
responseType: 'json',
accept: 'application/hal+json',
})
)
.pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<string>>;
})
);
}

/**
* Retrieve compilers
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `getCompilers$Response()` instead.
*
* This method doesn't expect any request body.
*/
getCompilers(params: { provider: string }): Observable<Array<string>> {
return this.getCompilers$Response(params).pipe(
map((r: StrictHttpResponse<Array<string>>) => r.body as Array<string>)
);
}

/**
* Path part for operation selectQpuForCircuitFile1
*/
Expand All @@ -307,8 +360,8 @@ export class RootService extends BaseService {
circuitLanguage: string;
tokens: {};
circuitName?: string;
compilers?: Array<string>;
body: { circuit?: Blob };
compilers: string[];
}): Observable<StrictHttpResponse<QpuSelectionJobDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -321,7 +374,7 @@ export class RootService extends BaseService {
rb.query('circuitLanguage', params.circuitLanguage, {});
rb.query('tokens', params.tokens, {});
rb.query('circuitName', params.circuitName, {});
rb.query('compilers', params)
rb.query('compilers', params.compilers, {});

rb.body(params.body, 'multipart/form-data');
}
Expand Down Expand Up @@ -354,8 +407,8 @@ export class RootService extends BaseService {
circuitLanguage: string;
tokens: {};
circuitName?: string;
compilers?: Array<string>;
body: { circuit?: Blob };
compilers: string[];
}): Observable<QpuSelectionJobDto> {
return this.selectQpuForCircuitFile1$FormData$Response(params).pipe(
map(
Expand All @@ -379,8 +432,8 @@ export class RootService extends BaseService {
circuitLanguage: string;
tokens: {};
circuitName?: string;
compilers?: Array<string>;
body: QpuSelectionDto;
compilers: string[];
}): Observable<StrictHttpResponse<QpuSelectionJobDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -393,7 +446,7 @@ export class RootService extends BaseService {
rb.query('circuitLanguage', params.circuitLanguage, {});
rb.query('tokens', params.tokens, {});
rb.query('circuitName', params.circuitName, {});
rb.query('compilers', params)
rb.query('compilers', params.compilers, {});

rb.body(params.body, 'application/xml');
}
Expand Down Expand Up @@ -426,8 +479,8 @@ export class RootService extends BaseService {
circuitLanguage: string;
tokens: {};
circuitName?: string;
compilers?: Array<string>;
body: QpuSelectionDto;
compilers: string[];
}): Observable<QpuSelectionJobDto> {
return this.selectQpuForCircuitFile1$Xml$Response(params).pipe(
map(
Expand All @@ -451,8 +504,8 @@ export class RootService extends BaseService {
circuitLanguage: string;
tokens: {};
circuitName?: string;
compilers?: Array<string>;
body: QpuSelectionDto;
compilers: string[];
}): Observable<StrictHttpResponse<QpuSelectionJobDto>> {
const rb = new RequestBuilder(
this.rootUrl,
Expand All @@ -465,7 +518,7 @@ export class RootService extends BaseService {
rb.query('circuitLanguage', params.circuitLanguage, {});
rb.query('tokens', params.tokens, {});
rb.query('circuitName', params.circuitName, {});
rb.query('compilers', params)
rb.query('compilers', params.compilers, {});

rb.body(params.body, 'application/json');
}
Expand Down Expand Up @@ -498,8 +551,8 @@ export class RootService extends BaseService {
circuitLanguage: string;
tokens: {};
circuitName?: string;
compilers?: Array<string>;
body: QpuSelectionDto;
compilers: string[];
}): Observable<QpuSelectionJobDto> {
return this.selectQpuForCircuitFile1$Json$Response(params).pipe(
map(
Expand Down Expand Up @@ -618,45 +671,4 @@ export class RootService extends BaseService {
)
);
}

/**
* Path part for operation getCompilers
*/
static readonly GetCompilersPath = '/compilers'

getCompilers$Response(params: {
provider: string;
}): Observable<StrictHttpResponse<string[]>> {
const rb = new RequestBuilder(
this.rootUrl,
RootService.GetCompilersPath,
'get'
);
if (params) {
rb.query('provider', params.provider, {});
}
return this.http
.request(
rb.build({
responseType: 'json',
accept: 'application/hal+json',
})
)
.pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<string[]>;
})
);
}

getCompilers(params: { provider: string; }): Observable<string[]> {
console.log("line 645");
return this.getCompilers$Response(params).pipe(
map(
(r: StrictHttpResponse<string[]>) => r.body as string[]
)
);
}

}
Loading

0 comments on commit d890537

Please sign in to comment.