Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-202

Nearby entity selection to select 2 entities that are somehow related (close to each other for example)

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Blocker
    • 6.2.0.Final
    • None
    • optaplanner-core
    • None

    Description

      In VRP, when there are 150 000 customers, there's little point in swapping customer A and Z if they are on oppose ends of the region. So when A is selected as primary entity, we want to have a high chance of selecting a secondary entity close to A (although the chance to select something far should be almost zero but not zero).

      Configuration might look something like this:

      <swapMoveSelector>
        <primary entitySelector id="leader"/>
        <secondary nearByEntitySelector>
           <mimicEntitySelector ref="leader"/>
           <nearByFinderClass>...NearByFinder</>
           <randomDistribution>NORMAL || GAUSS</>
         </>
      </>
      

      The same system might be reused in exam scheduling for course grained moves where one of the entities is a leader:

      <cartesianMoveSelector>
        <changeMoveSelector>
          <entitySelector id="leader"/>
        </>
        <changeMoveSelector>
          <nearByEntitySelector>
             <mimicEntitySelector ref="leader"/>
             <nearByFinderClass>...MyNearByFinder</>
             <randomDistribution>NORMAL || GAUSS</>
           </>
         </>
      </>
      

      MyNearByFinder could have an interface something like this

      Object nearByEntity(Object mainEntity, ScoreDirector scoreDirector);
      

      but what I really want is to have planner configuration deal with the NORMAL || GAUSS randomDistribution directly, so I want this too:

       // 0 < nearByIndex < entityCount
      // nearByIndex has a a high chance of being 1, 2, ... and a low chance of being ..., entityCount - 2, entityCount - 1.
      Object nearByEntity(Object mainEntity, int nearByIndex);
      

      Attachments

        Issue Links

          Activity

            People

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: