FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on...

12
FICO ® Xpress 8.5 .NET INTERFACE FICO ® Xpress Optimization

Transcript of FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on...

Page 1: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

FICO® Xpress

8.5

.NET INTERFACE

FICO® Xpress Optimization

Page 2: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

This material is the confidential, proprietary, and unpublished property of Fair IsaacCorporation. Receipt or possession of this material does not convey rights to divulge,reproduce, use, or allow others to use it without the specific written authorization of FairIsaac Corporation and use must conform strictly to the license agreement.

The information in this document is subject to change without notice. If you find anyproblems in this documentation, please report them to us in writing. Neither Fair IsaacCorporation nor its affiliates warrant that this documentation is error-free, nor are thereany other warranties with respect to the documentation except as may be provided in thelicense agreement.

© 2012 – 2018 Fair Isaac Corporation. All rights reserved. Permission to use this softwareand its documentation is governed by the software license agreement between thelicensee and Fair Isaac Corporation (or its affiliate). Portions of the program may containcopyright of various authors and may be licensed under certain third-party licensesidentified in the software, documentation, or both.

In no event shall Fair Isaac Corporation or its affiliates be liable to any person for direct,indirect, special, incidental, or consequential damages, including lost profits, arising out ofthe use of this software and its documentation, even if Fair Isaac Corporation or itsaffiliates have been advised of the possibility of such damage. The rights and allocation ofrisk between the licensee and Fair Isaac Corporation (or its affiliates) are governed by therespective identified licenses in the software, documentation, or both.

Fair Isaac Corporation and its affiliates specifically disclaim any warranties, including, butnot limited to, the implied warranties of merchantability and fitness for a particularpurpose. The software and accompanying documentation, if any, provided hereunder isprovided solely to users licensed under the Fair Isaac Software License Agreement. FairIsaac Corporation and its affiliates have no obligation to provide maintenance, support,updates, enhancements, or modifications except as required to licensed users under theFair Isaac Software License Agreement.

FICO is a registered trademark of Fair Isaac Corporation in the United States and may be aregistered trademark of Fair Isaac Corporation in other countries. Other product andcompany names herein may be trademarks of their respective owners.

FICO® Xpress 8.5

Deliverable Version: A

Last Revised: May 2018

Page 3: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Contents

Xpress Optimizer .NET Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Using the Wrapper in Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Using the New Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Controls and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Return Codes and Error Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Destroying the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Branch Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Appendix A: Contacting FICO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Product Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Product Education . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Sales and Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Related Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

FICO Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

About FICO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Fair Isaac Corporation Confidential and Proprietary Information 3

Page 4: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Contents

4 Fair Isaac Corporation Confidential and Proprietary Information

Page 5: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Xpress Optimizer .NET Interface

IntroductionApplications written in a .NET language, such as Visual C#, Visual Basic, Visual J#,or Visual C++, can use the Xpress-Optimizer via the .NET wrapper library.

The best way to get started using the wrapper is to open up the example projectsincluded with this package and experiment with them. The auto-completion featurein Visual Studio .NET can be used to obtain a full list of class methods andproperties and prototypes of each method.

Using the Wrapper in ProjectsThe Optimizer functionality is exposed through the XPRS and XPRSprob classes,which reside in the Optimizer namespace, which resides in the xprsdn.dllassembly.

Each source file that uses the Optimizer should import the Optimizer namespaceand should be compiled with a reference to xprsdn.dll.

To add a reference to a Visual Studio .NET project, select Add Reference from theProject menu. Click the Browse button and locate xprsdn.dll in the XpressMP\bin folder.

Users of the .NET command line compilers, for example, csc for C#, or vbc forVisual Basic, can add a reference with the /reference option:csc /reference:<path to xprsdn.dll> <your source file>

Using the New InterfaceThe .NET wrapper for the Xpress-Optimizer has been designed to look and feel likethe Common Language Runtime.

Compare code using the existing C and Visual Basic Optimizer interfaces with thefollowing C# example:using Optimizer;XPRS.Init("");Console.WriteLine(XPRS.GetBanner());XPRSprob prob = new XPRSprob();prob.ReadProb("myprob","");

Fair Isaac Corporation Confidential and Proprietary Information 5

Page 6: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

prob.Maxim("g");prob.Destroy();XPRS.Free();

The Optimizer functions have been renamed and put into classes. The functionname is missing the XPRS prefix, and according to the .NET naming convention,each word is capitalized. Functions operating on a problem pointer are methods ofan XPRSprob object; the rest are static methods of the XPRS class.

Controls and AttributesThe Optimizer controls and attributes are properties of the XPRSprob object.

They have been renamed in a similar way to the functions:prob.Presolve = 0;

The MIPStatus and LPStatus attributes are no longer integers but haveenumeration types, MIPStatus and LPStatus:if (prob.MIPStatus == MIPStatus.Infeasible) {...

CallbacksThe Optimizer callbacks are accessed using the .NET event / delegate mechanism.

For example, to install a method OptimizerMsg of the current class as acallback to receive Optimizer messages, you must to create aMessageCallback delegate object from the function and add it to theMessageCallbacks event field of the problem:prob.MessageCallbacks += new MessageCallback(this.OptimizerMsg);

To remove a callback you must still create a delegate object, but use the -=operator to remove it from the event field:prob.MessageCallbacks -= new MessageCallback(this.OptimizerMsg);

Return Codes and Error CheckingMost of the functions in the C interface to the Optimizer use an integer return codeto indicate if an error occurred.

The XPRS and XPRSprob member functions instead use the .NET exceptionmechanism to handle errors, throwing an exception of type XPRSException.This makes error handling easier, since a check is not required with every functioncall:try { XPRS.Init(""); Console.WriteLine(XPRS.GetBanner()); XPRSprob prob = new XPRSprob(); prob.ReadProb("myprob",""); prob.Maxim("g"); } catch (XPRSException e) {

: Xpress Optimizer .NET Interface

6 Fair Isaac Corporation Confidential and Proprietary Information

Page 7: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Console.WriteLine (e);}

Because the return code is not used to indicate error status, several methodsinstead return data that in the C interface is returned via an output parameter. Ingeneral, a function that retrieves a single value returns it, whereas a function thatretrieves more than one value is declared void and uses output parameters. Forexample:/* In C */char name[32];int ret = XPRSgetprobname (name);if (ret != 0) {.../* In C# */try {string name = prob.GetProbName ();} catch (XPRSException e) {...

Destroying the ProblemSince .NET uses a garbage collector, it does not provide a mechanism for explicitlydestroying objects.

Optimizer problems can take up large amounts of memory and so a Destroyfunction is provided to free up this memory. Any operation performed on anXPRSprob object after it has been destroyed will throw an exception.XPRSprob prob = new XPRSprob ();...prob.Destroy ();

Branch BoundsAnother notable change with the .NET interface is to the functions used to storeand set the bounds for node separation during a global search.

The C interface function XPRSstorebounds returns a void pointer, representing aset of bounds, to the user, which is then passed into the call toXPRSsetbranchbounds. The .NET interface replaces the void pointer with aBounds object, as demonstrated in the setbranchbounds example and below:Bounds b = prob.StoreBounds (nbnds, mcols, qbtype, dbd);prob.SetBranchBounds (b);

FICO® Xpress Optimizer

Fair Isaac Corporation Confidential and Proprietary Information 7

Page 8: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

: Xpress Optimizer .NET Interface

8 Fair Isaac Corporation Confidential and Proprietary Information

Page 9: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Appendix A

Contacting FICO

FICO provides clients with support and services for all our products. Refer to thefollowing sections for more information.

Product SupportFICO offers technical support and services ranging from self-help tools to directassistance with a FICO technical support engineer. Support is available to allclients who have purchased a FICO product and have an active support ormaintenance contract. You can find support contact information and a link to theCustomer Self Service Portal (online support) on the Product Support home page(www.fico.com/en/product-support).

The FICO Customer Self Service Portal is a secure web portal that is available 24hours a day, 7 days a week from the Product Support home page. The portal allowsyou to open, review, update, and close cases, as well as find solutions to commonproblems in the FICO Knowledge Base.

Product EducationFICO Product Education is the principal provider of product training for our clientsand partners. Product Education offers instructor-led classroom courses, web-based training, seminars, and training tools for both new user enablement andongoing performance support. For additional information, visit the ProductEducation home page (www.fico.com/en/product-training) or email [email protected].

Product DocumentationFICO continually looks for new ways to improve and enhance the value of theproducts and services we provide. If you have comments or suggestions regardinghow we can improve this documentation, let us know by sending your suggestionsto [email protected].

Fair Isaac Corporation Confidential and Proprietary Information 9

Page 10: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Sales and MaintenanceIf you need information on other Xpress Optimization products, or you need todiscuss maintenance contracts or other sales-related items, contact FICO by:

■ Phone: +1 (408) 535-1500 or +44 207 940 8718

■ Email: [email protected] or [email protected]

■ Web: http://www.fico.com/en/analytics/optimization and use the availablecontact forms

Related ServicesStrategy Consulting: Included in your contract with FICO may be a specified amountof consulting time to assist you in using FICO Xpress to meet your business needs.Additional consulting time can be arranged by contract.

Conferences and Seminars: FICO offers conferences and seminars on our productsand services. For announcements concerning these events, go to www.fico.com orcontact your FICO account representative.

FICO CommunityThe FICO Community is a great resource to find the experts and information youneed to collaborate, support your business, and solve common businesschallenges. You can get informal technical support, build relationships with localand remote professionals, and improve your business practices. For additionalinformation, visit the FICO Community (community.fico.com/welcome).

About FICOFICO (NYSE:FICO) powers decisions that help people and businesses around theworld prosper. Founded in 1956 and based in Silicon Valley, the company is apioneer in the use of predictive analytics and data science to improve operationaldecisions. FICO holds more than 165 US and foreign patents on technologies thatincrease profitability, customer satisfaction, and growth for businesses in financialservices, telecommunications, health care, retail, and many other industries. UsingFICO solutions, businesses in more than 100 countries do everything fromprotecting 2.6 billion payment cards from fraud, to helping people get credit, toensuring that millions of airplanes and rental cars are in the right place at the righttime. Learn more at www.fico.com.

Appendix A: Contacting FICO

10 Fair Isaac Corporation Confidential and Proprietary Information

Page 11: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Index

Aattributes 6

Bbranch bounds 7

Ccallbacks 6controls 6

Ddestroying the problem 7

Eerror checking 6

FFICO

about 10

community 10conferences and seminars 10consulting 10documentation 9education 9maintenance 10product support 9professional services 10sales 10support 9training 9

Iindex term 5introduction 5

Rreturn codes 6

Uusing the interface 5using the wrapper in projects 5

Fair Isaac Corporation Confidential and Proprietary Information 11

Page 12: FICO Xpress - MSI株式会社 · 2018-06-20 · FICO holds more than 165 US and foreign patents on technologies that increase profitability, customer satisfaction, and growth for

Index

12 Fair Isaac Corporation Confidential and Proprietary Information