OptaPlanner, build a rule that needs to get information from the solution - optaplanner

Need some ideas on how to build a rule in my task assignment project. Assign workers to tasks, each task has a happen location, want a soft constraint to make a worker's next task be as close as possible to the fulfilled task. But in DRL how can I know which task is the worker's previous task? the information is in the Solution class. An example is greatly appreciated. Is there any OptaPlanner example that I can refer to? for me to know how to get values from Solution.

There is a task assigning example in the optaplanner-examples module, which shows how to model such a problem. The main idea is that every task points to the next task and to the previous task or the worker. The worker is the first element of such a chain.
In this example, one of the goals is to minimize the makespan; your soft constraint about location sounds very similar - instead of penalizing for the amount of time required to complete all the tasks by a single worker, it would focus on the distance between locations associated with each task.

Related

In pyiron how to move some jobs to a different project?

In the project I'm working on right now, I realized that it makes more sense to move some of the jobs to a sub-group (which I just discovered with pr.create_group). I see that pr.move_to or pr.copy_to moves all jobs to a new project, but is there also a possibility to move some jobs to one sub-group and others to another one?
The job objects also have a move_to() function, so I would suggest to iterate over the jobs in a given project using iterjobs() and then move them individually. This even works in inspect mode https://github.com/pyiron/pyiron_base/blob/master/pyiron_base/job/core.py#L757

IntelliJ: See all changes for a specific "task"

IntelliJ has the "task" feature where you can track the context for a Jira task, for example.
Now, I changed several files within this task und committed a few times. After a week, I returned to this project and I'd like to see all changed files for this task, from the start of the task until where I left of. I cannot find an option to do this, is this somehow possible?
By default creating a new task offers you to create a separate branch for this task. If you did so, all your commits are in that branch.
If you used another branch, I don;t think there is an easy way to do what you want. You could try checking the saved contexts under Tools - Tasks and Context - Load context

What are the steps to convert a Scenario to BPMN?

I have an exam tomorrow and to be honest till now I don't know what are the steps that I should go through to design a given Scenario.
For example, when you see a scenario like this
Every weekday morning, the database is backed up and then it is checked to see whether the “Account Defaulter” table has new records. If no new records are found, then the process should check the CRM system to see whether new returns have been filed. If new returns exist, then register all defaulting accounts and customers. If the defaulting client codes have not been previously advised, produce another table of defaulting accounts and send to account management. All of this must be completed by 2:30 pm, if it is not, then an alert should be sent to the supervisor. Once the new defaulting account report has been completed, check the CRM system to see whether new returns have been filed. If new returns have been filed, reconcile with the existing account defaulters table. This must be completed by 4:00 pm otherwise a supervisor should be sent a message.
What is your approach to model this? I am not asking for the answer of this particular scenario, I am asking for the method. Do you design sentence by sentence? or do you try to figure out the big picture first then try to find the sub process?
There are no exact steps. Use imagination, Luke!)
You can take these funny instructions like a starting point, but they were made by dummies for dummies.
Commonly you should outline process steps and process participants on a sheet of paper schematically and try to build your model. No other way: only brainstorm.
When BPMN comes to mind, one thinks of people together in a conference room discussing how the business does things (creating what you call scenarios and translating to business processes) and drawing boxes and lines on a whiteboard.
Since 2012, when BPMN 2.0 appeared as an Object Management Group (OMG) specification, we have the very comprehensive 532-page .pdf file with pretty much all the information to create the process diagrams one needs.
Still, in addition to reading the previous file, one can also find many BPMN examples of common modeling problems, patterns, books and research papers which help to understand how certain scenarios come to live.
Generally speaking, we first identify who takes part in the process to understand who are the actors. After, we realize where they get (if they get) their input, what they do with it (if they do anything) and where they forward it after they have completed their work (if they forward). This allows to visualize each actor has specific tasks that follow a specific flow of work and can better draw it.
Then, once the clean and simple diagram is built, one can validate visualizing (IRL or not) the users / actors executing the activities.

Assignment Level custom field update for tasks

I am looking to update a Task Level custom field at the task assignment level. For ex, if a task has 2 resource assigned, i want one value to be "Offshore" and the other one to be "Onshore", when i view this task in the Task Usage view. Can someone help please?
Have you looked at this thread?
Use CSOM to update project's custom fields
It's Project level but it may provide some further clues.
Actually, there's task level code at the bottom of that post so hopefully, that's what you need.

Simulaneous changes to objects

I'm in the process of developing an app that manages the inventory in a shop. I assume that there could be potentially more than one user working with the app and therefore a scenario where both could reserver for checkout the same item (but for two different recipients is a likely one.
Are there any gems that or techniques someone could recommend that could help with this?
When the users create a new order they get the list of objects that are not reserved (this is a rental shop) but if one leaves the form open for a bit, without making the reservation, someone else still sees the item as available.
Can anyone offer advice about this? Hope the question is not too vague.
Is callbacks the way to go, by creating a before_save validation?
Thank you!
You can use a gem like delayed_job where you can schedule a job to be run at certain time, in this case, after a certain timeout.
You can then schedule a job which removes the reservation status on an item. If the user is successful in reserving the item, the delayed job needs to be deleted.
To delete the item from this activerecord table, you can find it based on the table attributes specified here.