An "interval variable type" in this context is essentially an integer label that categorizes different types of interval variables. This type is used to define a transition matrix, specifying transition times between different interval types.
How to Define Interval Variable Types
-
Assign an Integer Type to Each Interval Variable:
You need to associate each interval variable with an integer type. This integer serves as an identifier for that interval in the transition matrix.
-
Define the Transition Matrix Using Tuples:
The transition times are then modeled as tuples:
(interval_type_1, interval_type_2, transition_time)
Here, interval_type_1
and interval_type_2
are the integer types of the interval variables.
Example:
Let's assume you have three types of interval variables in a scheduling model:
-
Task A (Type 1)
-
Task B (Type 2)
-
Task C (Type 3)
You can define transition times as:
In your model, you should ensure that each interval variable has a corresponding type, and use this type to look up transition times in the matrix.
Would you like more details on how to integrate this with a specific solver (e.g., CPLEX, Google OR-Tools)? π
------------------------------
Eric Smock
------------------------------
Original Message:
Sent: Wed May 08, 2024 02:03 AM
From: Ross Dye
Subject: CP Optimizer + CMake + C++
I would like to define a transition matrix for Interval Variables
In some documentation I found a statement: "Transition times can be modeled using tuples with three elements. The first element is the interval variable type of one task, the second is the interval variable type of the other task and the third element of the tuple is the transition time from the first to the second. An integer interval variable type can be associated with each interval variable."
I have defined many interval variables in my model, but I cannot find out what an "interval variable type" is nor how to define it
------------------------------
Ross Dye
Original Message:
Sent: Tue May 07, 2024 04:55 AM
From: Thierry Sola
Subject: CP Optimizer + CMake + C++
Hello Ross,
You can use :
mdl.minimize(sum([end_of(itv) for itv in intervals]))
or
mdl.minimize(sum(end_of(itv) for itv in intervals))
Best regards,
------------------------------
Thierry Sola
Original Message:
Sent: Mon May 06, 2024 11:46 PM
From: Ross Dye
Subject: CP Optimizer + CMake + C++
Good morning
I am building a docplex scheduling model
It is all working well until I added a minimize statement:
model.minimize( itv.end for itv in intervals)
OR
model.add(model.minimize( itv.end for itv in intervals))
where intervals is a list of all interval variables in the model
These thoow an error:
Argument 'exprs' should be a float expression
Can anyone help me to understand the issue here please?
Ross Dye
0400669880
Original Message:
Sent: 5/3/2024 9:33:00 PM
From: Matheus Andrade
Subject: CP Optimizer + CMake + C++
Hello.
I am trying to setup a C++ project with CMake for the compilation. However, I am having some issues when linking the Cplex CPO. For linking the Cplex dependecies, I used the FindCPLEX.cmake
.
The complete setup can be seen in the repository, where I try to compile the cpoptimizer/examples/src/cpp/alloc.cpp
. Since I am not sure if I can share this file, I left an empty src/main.cpp
in the repository, so if someone wants to reproduce the experiment, you will have to ctrl+c/ctrl+v
the content from your cplex folder.
Below follows my CMakeLists.txt
:
cmake_minimum_required(VERSION 3.23)project(CplexCP)##### SETsset (Project_PATH "${PROJECT_SOURCE_DIR}")set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/support/cmake)set (CMAKE_BUILD_TYPE Release) set (CMAKE_CXX_STANDARD 20)set (BUILD_SHARED_LIBS On)##### Packagesfind_package (CPLEX)##### Include Dirs link_directories(${CPLEX_CP_LIBRARY})include_directories( SYSTEM includes "${PROJECT_BINARY_DIR}" "${CPLEX_CONCERT_INCLUDE_DIR}" "${CPLEX_ILOCPLEX_INCLUDE_DIR}" "${CPLEX_CP_INCLUDE_DIR}" )##### Compile options add_compile_options(-Wall # -DIL_STD -Wfatal-errors -pedantic -fopenmp -DDEBUG -fdiagnostics-color=always -lz -std=c++20 # CPLEX -lconcert -lilocplex -lcplex -lcplex-cp -lcplex-concert -lcplex-library # -lm -lpthread -ldl -Wno-sign-compare )file(GLOB_RECURSE SOURCES "src/*.cpp")add_executable( main ${SOURCES} )target_link_libraries( main ${CPLEX_CONCERT_LIBRARY} ${CPLEX_ILOCPLEX_LIBRARY} ${CPLEX_LIBRARY} ${CPLEX_CP_LIBRARY} ${CPLEX_CP_LIBRARY_DEBUG} pthread m dl )
The cmake
command works just fine, but the make
, results in the following. The complete log can be seen here.
/usr/bin/ld: /opt/ibm/ILOG/CPLEX_Studio2211/cpoptimizer/lib/x86-64_linux/static_pic/libcp.a(cpengine.o): in the function `IlcCPEngineI::IlcCPEngineI(IlcCPI*, IlcAllocator*, long, IlcCPOManagerI*)':cpengine.cpp:(.text+0x8ae6): reference to `CPXEclocksync' not defined.../usr/bin/ld: /opt/ibm/ILOG/CPLEX_Studio2211/cpoptimizer/lib/x86-64_linux/static_pic/libcp.a(linoptcplex.o): in the function `IlcLinOptCplex::parameterConfiguration(long, double)':linoptcplex.cpp:(.text+0x5ad1): reference to `CPXsetintparam' not definedcollect2: error: ld returned 1 exit statusmake[2]: *** [CMakeFiles/main.dir/build.make:102: main] Error 1make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/main.dir/all] Error 2make: *** [Makefile:91: all] Error 2
What am I missing in my CMakeLists.txt
?
Thanks and regards.
------------------------------
Matheus Andrade
------------------------------