Welcome to the IBM Community, a place to collaborate, share knowledge, & support one another in everyday challenges. Connect with your fellow members through forums, blogs, files, & face-to-face networking.
Log in
Search Options
Search Options
Skip to main content (Press Enter).
Sign in
Skip auxiliary navigation (Press Enter).
Data Science
Topic groups
Global Data Science
Decision Optimization
SPSS Modeler
SPSS Statistics
Watson Studio
Data and AI Learning
User groups
Events
Upcoming Events
On Demand Webinars
IBM Expert TV
Virtual Community Events
All IBM Community Events
Participate
Gamification Program
Post to Forum
Share a Resource
Blogging on the Community
Connect with Data Science Users
All IBM Community Users
Resources
Community Front Porch
IBM Champions
IBM Cloud Support
IBM Documentation
IBM Support
IBM Technology Zone
IBM Training
Data Science Elite
Marketplace
Marketplace
IBM Data Science Community
Master the art of data science.
Join now
Skip main navigation (Press Enter).
Toggle navigation
Search Options
Decision Optimization
View Only
Group Home
Discussion
55.7K
Library
1.9K
Blogs
66
Events
0
Members
1.5K
Expand all
|
Collapse all
sort by most recent
sort by thread
generate release time randomly
Junaid
Mon August 10, 2020 10:12 AM
I wanna to generate release time randomly and make the trains' departure time equals to it. I writ...
ALEX FLEISCHER
Mon August 10, 2020 01:21 PM
Hi similar to https://community.ibm.com/community/user/datascience/communities/community-home/di...
1.
generate release time randomly
0
Like
Junaid
Posted Mon August 10, 2020 10:12 AM
Reply
Reply Privately
Options Dropdown
I wanna to generate release time randomly and make the trains' departure time equals to it. I write it as follows and I got something wrong with assignment statement.
execute {
cplex.tilim = 120;
for (var k in orders)
{ writeln("\n origin release time is"+k.release_time);
k.release_time = Opl.rand(7); //
This is wrong.
}
}
my data file is :
// volume due_time release_time
orders = {<1, {"Beijing"},{"Hamburg"}, 24, 26, 0>,
<2, {"Yinchuan"},{"Hamburg"}, 26, 20, 0>,
<3, {"Shanghai"},{"Hamburg"}, 18, 28, 0> };
Is it because I already define the value of release time in data file? How can I change it ? I need to change the release time of every order in each iteration.
Regards
Programmer
------------------------------
Junaid -
Ainit Dubai
------------------------------
2.
RE: generate release time randomly
0
Like
ALEX FLEISCHER
Posted Mon August 10, 2020 01:21 PM
Reply
Reply Privately
Options Dropdown
Hi
similar to
https://community.ibm.com/community/user/datascience/communities/community-home/digestviewer/viewthread?GroupId=5557&MessageKey=f3516283-3fb7-437c-81bd-3247e99fdcec&CommunityKey=ab7de0fd-6f43-47a9-8261-33578a231bb7&tab=digestviewer&ReturnUrl=%2fcommunity%2fuser%2fdatascience%2fcommunities%2fcommunity-home%2fdigestviewer%3fcommunitykey%3dab7de0fd-6f43-47a9-8261-33578a231bb7%26tab%3ddigestviewer
regards
------------------------------
ALEX FLEISCHER
------------------------------
Original Message
Original Message:
Sent: Mon August 10, 2020 03:12 AM
From: Junaid
Subject: generate release time randomly
I wanna to generate release time randomly and make the trains' departure time equals to it. I write it as follows and I got something wrong with assignment statement.
execute {
cplex.tilim = 120;
for (var k in orders)
{ writeln("\n origin release time is"+k.release_time);
k.release_time = Opl.rand(7); //
This is wrong.
}
}
my data file is :
// volume due_time release_time
orders = {<1, {"Beijing"},{"Hamburg"}, 24, 26, 0>,
<2, {"Yinchuan"},{"Hamburg"}, 26, 20, 0>,
<3, {"Shanghai"},{"Hamburg"}, 18, 28, 0> };
Is it because I already define the value of release time in data file? How can I change it ? I need to change the release time of every order in each iteration.
Regards
Programmer
------------------------------
Junaid -
Ainit Dubai
------------------------------
×
New Best Answer
This thread already has a best answer. Would you like to mark this message as the new best answer?
Data Science
Topic groups
Global Data Science
Decision Optimization
SPSS Modeler
SPSS Statistics
Watson Studio
Data and AI Learning
User groups
Events
Upcoming Events
On Demand Webinars
IBM Expert TV
Virtual Community Events
All IBM Community Events
Participate
Gamification Program
Post to Forum
Share a Resource
Blogging on the Community
Connect with Data Science Users
All IBM Community Users
Resources
Community Front Porch
IBM Champions
IBM Cloud Support
IBM Documentation
IBM Support
IBM Technology Zone
IBM Training
Data Science Elite
Marketplace
Marketplace
Copyright © 2019 IBM Data Science Community. All rights reserved.
Powered by Higher Logic