You can access the capabilities of the Tradeoff Analytics service via an HTTP Representational State Transfer (REST) API. Software Development Kits (SDKs) are also available to simplify application development in various languages. The following sections provide an overview of application development with the service.
To use the Tradeoff Analytics service, you pass a decision problem to the HTTP
POST dilemmas method of the service's API. You represent a decision problem as a JSON object. The following example shows how such a construct relates to the tabular representation of a simple problem.
The example includes two objectives specified via the
columns parameter with
keys obj1 and obj2. Each has a
full_name that describes the objective, a
type of numeric, and the boolean parameter
is_objective set to true to indicate that the service is to evaluate each option against it. The
goal of the first objective specifies that it is to be minimized (min), while that of the second indicates that it is to be maximized (max).
The JSON further specifies two options via the
options parameter. Each option has a
key and a
name, and each includes
values for both of the objectives. The image shows how the objectives and options specified in the JSON relate to the decision problem.
The service returns a
Dilemma in the form of a JSON object that contains two constructs: the original
problem and its
solutions that describe how the options stack up against both the objectives and each other. By default, the
resolution also includes a
map with the parameters needed to represent the problem and its solutions on the two-dimensional visualization in the service's graphical interface.
Use of the interactive interface is optional, and an application can call the service without invoking the interface. The service can return just the results of its analysis without including the parameters needed for the interface and its visualization. For more information about working with the interactive interface, see Using the visualization interface and Programming with the widget.
The Tradeoff Analytics service supports a number of SDKs for simplified application development. The SDKs are available for many popular programming languages and platforms, including Node.js, Java, Python, and Apple® iOS. For a complete list of SDKs and information about using them, see Watson SDKs. All SDKs are available from the watson-developer-cloud namespace on GitHub.
The service also makes available the following sample applications to help you get started:
All SDKs support authenticating by using either your Bluemix® service credentials or an authentication token.
The Tradeoff Analytics service supports two typical programming models: Direct interaction, in which the client communicates with the service directly; and relaying via a proxy, in which the client and service exchange all data (requests and results) through a proxy application that resides in Bluemix®.
For more information about working with Watson Developer Cloud services and Bluemix, see the following:
For an introduction to working with Watson services and Bluemix, see Getting started with Watson and Bluemix.
For a language-independent introduction to developing Watson services applications in Bluemix, see Bluemix development approaches.
For information about the two programming models available for developing Watson applications, see Programming models for Watson services:
For information about controlling the default request logging that is performed for all Watson services, see Controlling request logging for Watson services.