Abstract
We have proposed and implemented the language CoJava, which offers both the advantages of simulation-like process modeling in Java, and the capabilities of true decision optimization. By design, the syntax of CoJava is identical to the programming language Java, extended with special constructs to (1) make a nondeterministic choice of a numeric value, (2) assert a constraint, and (3) designate a program variable as the objective to be optimized. A sequence of specific selections in nondeterministic choice statements corresponds to an execution path. We define an optimal execution path as one that (1) satisfies the range conditions in the choice statements, (2) satisfies the assert-constraint statements, and (3) produces the optimal value in a designated program variable, among all execution paths that satisfy (1) and (2). The semantics of a CoJava program amounts to first finding an optimal execution path, and then procedurally executing it. To find an optimal execution path, the implemented CoJava compiler reduces the problem to a standard optimization formulation, and then solves it on an external solver. Then, the CoJava program is run as a Java program, where the choice statements select the found optimal values, and the assert and optimization statements are ignored. We illustrate the usage and semantics of CoJava using a simple supply-chain example, in which elastic demand, a manufacturer and a supplier are modeled as Java classes.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Goldberg, A., Robson, D.: Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc., Boston (1983)
Gosling, J., Joy, B., Steele, G.: The Java language specication. Addison-Wesley Longman Publishing Co., Inc., Boston (1996)
Dahl, O.-J., Nygaard, K.: Simula: an algol-based simulation language. Commun. ACM 9, 671–678 (1966)
Thomasma, T., Madsen, J.: Object oriented programming languages for developing simulation-related software. In: WSC 1990: Proceedings of the 22nd conference on Winter simulation, Piscataway, NJ, USA, pp. 482–485. IEEE Press, Los Alamitos (1990)
Healy, K.J., Kilgore, R.A.: Introduction to silk and java-based simulation. In: WSC 1998: Proceedings of the 30th conference on Winter simulation, pp. 327–334. IEEE Computer Society Press, Los Alamitos (1998)
Bizarro, P., Silva, L.M., Silva, J.G.: Jwarp: A java library for parallel discrete-event simulations. In: Proceedings of the ACM Workshop on Java for High- Performance Network Computing, pp. 999–1005 (1998)
Fourer, R., Gay, D.M., Kernighan, B.W.: A modeling language for mathematical programming. Manage. Sci. 36, 519–554 (1990)
Boisvert, R.F., Howe, S.E., Kahaner, D.K.: Gams: a framework for the management of scientific software. ACM Trans. Math. Softw. 11, 313–355 (1985)
Van Hentenryck, P., Michel, L., Perron, L., Régin, J.C.: Constraint programming in opl. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 98–116. Springer, Heidelberg (1999)
Jaffar, J., Lassez, J.-L.: Constraint logic programming. In: POPL 1987: Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pp. 111–119. ACM Press, New York (1987)
Caseau, Y., Josset, F.X., Laburthe, F.: CLAIRE: combining sets, search and rules to better express algorithms. Theory and Practice of Logic Programming 2, 769–805 (2002)
Smolka, G., Henz, M., Wurtz, J.: Object-oriented concurrent constraint programming in Oz. Principles and Practice of Constraint Programming, 29–48 (1995)
Wallace, M., Novello, S., Schimpf, J.: ECLiPSe: A platform for constraint logic programming. ICL Systems Journal 12, 159–200 (1997)
Puget, J.F., Leconte, M.: Beyond the glass box: Constraints as objects. In: International Logic Programming Symposium, pp. 513–527 (1995)
Apt, K., Schaerf, A.: Search and imperative programming. In: Conference Record of POPL 1997: The 24TH ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, New York, NY, pp. 67–79 (1997)
Jayaraman, B., Tambay, P.: Semantics and applications of constrained objects. Technical Report 2001-15 (2001)
Horn, B.L.: Siri: a constrained-object language for reactive program implementation. School of Computer Science, Carnegie Mellon University, Pittsburgh (1991)
Puget, J.F.: A c++ implementation of clp. In: Proceedings of SPICIS (1994)
Laburthe, F.: Choco: Implementing a cp kernel. In: CP00 Post Conference Workshop on Techniques for Implementing Constraint programming Systems (TRICS), Singapore, pp. 71–85 (2000)
Schulte, C., Tack, G.R.: Views and iterators for generic constraint implementations. In: Hnich, B., Carlsson, M., Fages, F., Rossi, F. (eds.) CSCLP 2005. LNCS, vol. 3978, pp. 118–132. Springer, Heidelberg (2006)
Brodsky, A., Segal, V.E., Chen, J., Exarkhopoulo, P.A.: The ccube constraint object-oriented database system. Constraints 2, 245–277 (1997)
Borning, A.: The programming language aspects of thinglab, a constraint-oriented simulation laboratory. ACM Trans. Program. Lang. Syst. 3, 353–387 (1981)
Freeman-Benson, B.N.: Kaleidoscope: mixing objects, constraints, and imperative programming. In: OOPSLA/ECOOP 1990: Proceedings of the European conference on object-oriented programming on Object-oriented programming systems, languages, and applications, pp. 77–88. ACM Press, New York (1990)
Fritzson, P.A., Engelson, V.: Modelica - A unified object-oriented language for system modeling and simulation. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 67–90. Springer, Heidelberg (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brodsky, A., Nash, H. (2006). CoJava: Optimization Modeling by Nondeterministic Simulation. In: Benhamou, F. (eds) Principles and Practice of Constraint Programming - CP 2006. CP 2006. Lecture Notes in Computer Science, vol 4204. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11889205_9
Download citation
DOI: https://doi.org/10.1007/11889205_9
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-46267-5
Online ISBN: 978-3-540-46268-2
eBook Packages: Computer ScienceComputer Science (R0)