input
stringlengths
10
828
output
stringlengths
5
107
protected list get model children list children new linked list children add all get logic diagram get children children add all get child constraint violations return children
returns the children of this through the model
public connection anchor get source connection anchor request request point pt new point drop request request get location try if request instanceof create connection request create connection request request get target edit part null model object model model object create connection request request get target edit part get model if model null return get node figure get target connection anchor at pt model catch exception e e print stack trace return get node figure get source connection anchor at pt
returns the connection anchor of a source connection which is at the
public void init istructured selection selection ijava element jelem get initial java element selection init container page jelem if showpkg init type page jelem do status update
the wizard owning this page is responsible for calling this method with the
public connection anchor get target connection anchor request request point pt new point drop request request get location try if request instanceof create connection request create connection request request get source edit part null model object model model object create connection request request get source edit part get model if model null return get node figure get target connection anchor at pt model catch exception e e print stack trace return get node figure get target connection anchor at pt
returns the connection anchor of a terget connection which is at the
protected void refresh visuals point loc get logic subpart get location dimension size get logic subpart get size if loc null size null loc new point 0 0 size new dimension 50 50 rectangle r new rectangle loc size if get parent null graphical edit part get parent set layout constraint this get figure r
updates the visual aspect of this
public void attach part model object part int alignment if get map contains key part get alignment part alignment return get map put part new integer alignment logic guide parent is horizontal part get horizontal guide part get vertical guide if parent null parent this parent detach part part if is horizontal part set horizontal guide this else part set vertical guide this listeners fire property change property children null part
attaches the given part along the given edge to this guide
public void detach part model object part if get map contains key part get map remove part if is horizontal part set horizontal guide null else part set vertical guide null listeners fire property change property children null part
detaches the given part from this guide
public int get alignment model object part if get map get part null return integer get map get part int value return 2
this methods returns the edge along which the given part is attached to
protected final string text 4 nl protected final string text 5 plugin get default get preference store set default nl palette size default palette size nl nl nl nl nl public dsmleditor nl super nl nl nl nl protected string get model id nl t treturn
protected final string text 3 nl nl nl import org
public object get property value object prop name if prop name equals annotation if annotation null annotation return annotation else if name equals prop name return get attribute name else if id id equals prop name return get id else if id size equals prop name return new dimension property source get size else if id location equals prop name return new location property source get location else if tag equals prop name return get gems tag else if prop name instanceof string return get attribute string prop name return null
returns an object which represents the appropriate value for the property
public void set property value object id object value object valuepair id value model change event event new model change event this model change event element attribute changed true object valuepair model event dispatcher dispatch event if event vetoed return if id equals annotation set annotation string value else if id size equals id set size dimension value else if id id equals id set id value else if id location equals id set location point value else if id instanceof string set attribute string id value
sets the value of a given property with the value supplied
protected boolean calculate enabled command command null if get clipboard contents null command create paste command return command null command can execute
returns code true code if the
protected command create paste command if get selected objects null get selected objects is empty return null create request request new create request request set factory get factory get clipboard contents request set location get paste location object obj get selected objects get 0 if obj instanceof edit part return edit part obj get command request return null
creates and returns a command which may be code null code to
protected key handler get common key handler if shared key handler null shared key handler new key handler shared key handler put key stroke get pressed swt del 127 0 get action registry get action gefaction constants delete shared key handler put key stroke get pressed swt f2 0 get action registry get action gefaction constants direct edit return shared key handler
returns the key handler with common bindings for both the outline and
public int domain var make enum int var string name int min int max int domain var v create int var name int domain var list min max int vars add v return v
creates a new search variable with an enumerated domain
public void record solution solution sol make solution from current state store solution sol
recording the current state as a solution
public void show solution system out println problem pretty todo
showing information about the last solution
public int domain var make enum int var string name int values int values2 new int values length system arraycopy values 0 values2 0 values length arrays sort values2 int domain var v create int var name values2 int vars add v return v
creates a new search variable with an enumerated domain
public int domain var make bound int var string name int min int max int domain var v create int var name int domain var bounds min max int vars add v return v
creates a new search variable with an interval domain
public real var make real var string name double min double max real var v create real val name min max float vars add v return v
creates a real variable
public real var make real var double inf double sup return make real var inf sup
creates an anonymous real variable
public real var make real var string name return make real var name double negative infinity double positive infinity
creates an unbounded real variable
public set var make set var string name int a int b set var v create set var name a b set vars add v return v
creates a set variable
public int exp mult int a int exp x if a 0 int term t new int term 1 t set coefficient 0 a t set variable 0 int var x return t else return null
creates a simple linear term from one coefficient and one variable
public void add sub variables int i int domain var v while subvariables size i subvariables add new array list nb sub problems 1 array list subvariables get i add v
add a variable to a given sub problem
public int exp scalar int lc int var lv int n lc length assert lv length n int term t new int term n for int i 0 i n i t set coefficient i lc i if lv i instanceof int var t set variable i int var lv i else throw new error unknown kind of int domain var return t
building a term from a scalar product of coefficients and variables
public int exp sum int exp lv int n lv length int term t new int term n for int i 0 i n i t set coefficient i 1 if lv i instanceof int var t set variable i int var lv i else throw new error unexpected kind of int exp return t
building a term from a sum of integer expressions
public void set bound int objval get objective value if do maximize lower bound arithm max lower bound objval else upper bound arithm min upper bound objval
resetting the optimization bounds
public constraint make equation real exp exp real interval constant cst collect the variables set collected vars new hash set exp collect vars collected vars real var tmp vars new real var 0 tmp vars real var collected vars to array tmp vars return create equation tmp vars exp cst
makes an equation from an expression and a constantt interval
public void post constraint cc if cc instanceof palm constraint palm constraint c palm constraint cc int idx constraints add c c add listener true jump constraint plugin c get plug in set constraint idx idx constraints size 1 constraint event event constraint event c get event propagation engine pe get propagation engine pe register event event pe post const awake c true else throw new error impossible to post to a jump problem constraints that are not palm constraints
posts a constraints in the problem
public void post cut constraint cc if cc instanceof palm constraint palm constraint c palm constraint cc int idx constraints static add c c add listener false jump constraint plugin c get plug in set constraint idx idx constraints size 1 constraint event event constraint event c get event propagation engine pe get propagation engine pe register event event pe post const awake c true else throw new error impossible to post to a jump problem cuts that are not palm constraints
posts a cut constraint in the problem
public void reset this event type this old event type this cause var event nocause assert this event type emptyevent
resets this event if interrupted during execution
public void add decision constraint abstract constraint cst decision constraints add cst
adds a new decision constraint on this variable
public void self explain int select explanation e if silent switch select case inf e merge constraint collection this explanation on inf get last break case sup e merge constraint collection this explanation on sup get last break case dom e merge constraint collection this explanation on inf get last e merge constraint collection this explanation on sup get last break
explains the state of this domain
public void update decision constraints java util bit set constraints decision constraints get bit set for int i constraints next set bit 0 i 0 i constraints next set bit i 1 if palm problem this problem get constraint nb i null palm problem this problem get constraint nb i is active constraints clear i
updates decision constraints by removing not up to date ones
public void awake throws contradiction exception explanation expl palm problem this get problem make explanation palm constraint plugin this hook self explain expl this cste new palm real interval constant cste get inf cste get sup palm explanation expl copy expl super awake
first propagation update the explanation of the constant interval with
public constraint negate return new palm split left v0 previous
returns the opposite of this constraint that is a split left constraint
public constraint negate return new palm split right v0 previous
returns the opposite of this constraint that is a split right constraint
public void awake throws contradiction exception explanation expl palm problem this get problem make explanation palm constraint plugin this get plug in self explain expl current new palm real interval constant current get inf current get sup palm explanation expl copy expl propagate
first propagation of the constraint
public constraint make equation real exp exp real interval constant cst collect the variables set collected vars new hash set exp collect vars collected vars real var tmp vars real var collected vars to array return new palm equation problem tmp vars exp cst
makes an equation from an expression and a constantt interval
public real exp plus real exp exp1 real exp exp2 return new palm real plus problem exp1 exp2
addition of two expressions
public real exp minus real exp exp1 real exp exp2 return new palm real minus problem exp1 exp2
substraction of two expressions
public real exp mult real exp exp1 real exp exp2 return new palm real mult problem exp1 exp2
multiplication of two expressions
public object select branching object palm problem problem palm problem this extender get manager get problem int nbvars problem get nb real vars if nbvars 0 return null int start current 1 nbvars 1 current int n current 1 nbvars while n start problem get real var n is instantiated n n 1 nbvars if problem get real var n is instantiated return null current n return problem get real var n
returns the next variable to split
public object select first branch object item list list new linked list palm real var var palm real var item abstract constraint cst new palm split left var new real interval constant var palm explanation expl palm explanation palm real domain var get domain get decision constraints if expl size 0 palm constraint plugin cst get plug in set depending expl list add cst return list
returns the decision constraint to add w
public void intersect real interval interval int index throws contradiction exception if interval get inf inf get inf set interval get inf explanation on inf empties palm real interval interval self explain inf explanation on inf if interval get sup sup get sup set interval get sup explanation on sup empties palm real interval interval self explain sup explanation on sup if inf get sup get explanation e palm problem this get problem make explanation this self explain dom e explained problem this get problem explained fail e
updates the interval such that this interval is included in the interval parameter
public void project throws contradiction exception exp1 intersect palm real math add palm problem this get problem this exp2 exp2 intersect palm real math sub palm problem this get problem exp1 this
projects current value on sub expressions
public void self explain int select constraint collection e switch select case inf e merge constraint collection this explanation on inf break case sup e merge constraint collection this explanation on sup break case dom e merge constraint collection this explanation on inf e merge constraint collection this explanation on sup break
explains the state of this expression lower upper bounds or all domain
public void tighten palm real interval res palm real math mul palm problem this get problem exp1 exp2 inf set res get inf sup set res get sup explanation on inf empties res self explain inf explanation on inf explanation on sup empties res self explain sup explanation on sup
tightens the value of the expressions
public void project throws contradiction exception palm real interval res palm real math odiv wrt palm problem this get problem this exp2 exp1 if res get inf res get sup problem get propagation engine raise contradiction exp1 intersect res res palm real math odiv wrt palm problem this get problem this exp1 exp2 if res get inf res get sup problem get propagation engine raise contradiction exp2 intersect res
projects current value on sub expressions
public void self explain final int select final explanation e switch select case inf e merge constraint collection this explanation on inf break case sup e merge constraint collection this explanation on sup break case dom e merge constraint collection this explanation on inf e merge constraint collection this explanation on sup break default throw new error invalid request of explanation
explains the state of this expression lower upper bounds or all domain
public void project throws contradiction exception exp1 intersect palm real math sub palm problem this get problem this exp2 exp2 intersect palm real math sub palm problem this get problem this exp1
projects current value on sub expressions
public void self explain int select explanation e if explanation on inf null switch select sinon explication vide case inf e merge constraint collection this explanation on inf break case sup e merge constraint collection this explanation on sup break case dom e merge constraint collection this explanation on inf e merge constraint collection this explanation on sup break
explains the values of the constant
public void awake on restore final int idx throws contradiction exception explanation expl explained problem this get problem make explanation explained constraint plugin this hook self explain expl explained int var v0 update inf cste c idx0 explanation expl copy explained int var v0 update sup lvals length 1 cste c idx0 explanation expl copy if idx 0 update index from value else update value from index
propagation when a value is restored to a domain for repairing a
public boolean is entailed if logger get logger choco prop const is loggable level warning logger get logger choco prop const warning not yet implemented not equal is entailed return null
checks if the constraint is entailed it can be proven that the
public set why is true if logger get logger choco prop const is loggable level warning logger get logger choco prop const warning not yet implemented not equal why is true return null
determines why the constraints is satified
public set why is false if logger get logger choco prop const is loggable level warning logger get logger choco prop const warning not yet implemented not equal why is false return null
determines why the constraints is not satified
public boolean search one solution solver get search solver run return this is feasible
searches one solution of the problem
public boolean solve boolean all solutions solver set first solution all solutions solver generate search solver this this feasible boolean false try solver get search solver new tree search catch contradiction exception e logger severe should not happen palm problem solve boolean if all solutions boolean soluble this search one solution boolean true while soluble logger info a solution was found soluble palm global search solver solver get search solver get state discard current solution this search one solution boolean true else return this search one solution solver get search solver end tree search return boolean true
tries to search the problem by finding one solution or all solutions
public boolean solve solver generate search solver this this feasible boolean false try solver get search solver new tree search catch contradiction exception e logger severe should not happen palm problem solve boolean solver get search solver run if this is feasible boolean false solver get search solver end tree search return this is feasible
tries to search the i first i solution of the problem
public boolean next solution if palm global search solver solver get search solver get state discard current solution solver get search solver run else solver get search solver end tree search return boolean false if this is feasible boolean false solver get search solver end tree search return this is feasible
tries to find another solution
public boolean check solution try this propagate return true catch palm contradiction e return false catch contradiction exception e logger severe this should not happen palm problem check solution return false
checks if current solution is still valid
public boolean solve all solver generate search solver this this feasible boolean false try solver get search solver new tree search catch contradiction exception e logger severe should not happen palm problem solve boolean solver get search solver run boolean soluble this is feasible boolean true while soluble logger info a solution was found soluble palm global search solver solver get search solver get state discard current solution if soluble solver get search solver run soluble this is feasible boolean true solver get search solver end tree search return is feasible
tries to find all solutions of the problem
public boolean maximize var objective boolean restart palm solver solver set objective objective palm solver solver set do maximize true solver generate search solver this solver get search solver run return this is feasible
maximize an objective variable with a palm branch and bound
public boolean minimize var objective boolean restart palm solver solver set objective objective palm solver solver set do maximize false solver generate search solver this solver get search solver run return this is feasible
minimize an objective variable with a palm branch and bound
public void post constraint constraint int w this post constraint palm constraint plugin propagator constraint get plug in set weight w
posts a constraint with the specified weight
public void post constraint constraint palm explanation expl palm constraint plugin propagator constraint get plug in set indirect expl this post constraint
posts an indirect constraint with an explain
public void propagate all decisions constraints list constraints throws contradiction exception this palm solver inc runtime statistic ext 1 move in explore for iterator iterator constraints iterator iterator has next abstract constraint constraint abstract constraint iterator next this post constraint 0 avant la mise a jour de l etat sinon la contrainte n existe pas encore palm global search solver solver get search solver get state add decision constraint this propagate
posts and propagates several decision constraints that is decisions taken by the solver
public boolean finished branching object item object previous branch return wrapper finished branching palm int var item decision constraint list previous branch get 0 get branch
checks whether all branches have already been explored at the current choice point
public constraint nth int var index int values int var val return create subscript index values val 0
subscript constraint accessing an array with a variable index
public constraint nth int var index int var var array int var val return create subscript index var array val 0
subscript constraint accessing an array of variables with a variable index
public void runonce long time system current time millis try while this finished try if logger get logger choco is loggable level fine logger get logger choco fine new extension launched this extend this problem propagate catch palm contradiction e this repair this problem feasible boolean true catch contradiction exception e this finished true this problem feasible boolean false this set runtime statistic palm problem cpu int system current time millis time
solving the feasibility problem
public constraint bool channeling int var b int var x int j int var boolv intv if int domain var b get inf 0 int domain var b get sup 1 boolv b intv x else boolv x intv b if int domain var boolv get inf 0 int domain var boolv get sup 1 int domain var intv can be instantiated to j return create bool channeling boolv intv j else throw new error b should be a boolean variable and j should belongs to the domain of x
state a simple channeling bewteen a boolean variable and an interger variable
public constraint all different int var vars return all different vars true
all different constraints with a global filtering
public constraint all different int var vars boolean global if global if int domain var vars 0 has enumerated domain return create all different vars else return create bound all diff vars true else return create bound all diff vars false
all different constraints v1 v2 v1 v3 v2 v3
public constraint lexeq int var v1 int var v2 if v1 length v2 length throw new error the vectors of variables should be of same size for lex v1 length and v2 length return create lex v1 v2 false
enforce a lexicographic ordering on two vectors of integer
public constraint lex int var v1 int var v2 if v1 length v2 length throw new error the vectors of variables should be of same size for lex v1 length and v2 length return create lex v1 v2 true
enforce a strict lexicographic ordering on two vectors of integer
protected void change goal abstract int branching branching branching set solver this if slave current ctx null trace stack new array list current trace index 1 main goal branching next move init search
change the goal of the search solver called when one want to solve
public constraint set inter set var sv1 set var sv2 set var inter return create set intersection sv1 sv2 inter
enforce a set to be the intersection of two others
public void set cuts constraint nogood constraint cuts this cuts cuts
set the way benders cut are managed
public void next master move master set current fail explanation fail copy choose one explanation among all cuts master next move up branch restart the master from the current master solution fail null if logger is loggable level fine logger fine start masterpb
describes the way the master search solver has to be set
public void set sub var selector int i ivar selector var selector init heuristic sub var selector this sub var selector set i var selector
sets the variable selector the search solver should use
public void set sub val iterator int i ival iterator val iterator init heuristic sub val iterator sub val iterator set i val iterator
sets the value iterator the search should use
public void set sub val selector int i ival selector val selector init heuristic sub val selector this sub val selector set i val selector
sets the value selector the search should use
public void delete match int i int j assert 1 i i nb left vertices 1 j j nb right vertices if j this ref match get i this ref match set i 1 this decrease matching size j
remove the assignment of j to the ith variable
public boolean must grow flow from source int j return this flow get j this min flow j
check if j should be assigned to other variables
public void increase matching size int j this matching size add 1 this flow set j this flow get j 1
updates the matching size when one more left vertex is matched with j
public void decrease matching size int j this matching size add 1 this flow set j this flow get j 1
updates the matching size when the matching is rebuilt
public object clone throws clone not supported exception abstract bipartite matching newc abstract bipartite matching super clone newc init abstract bipartite matching return newc
builds a copy of this contraint
public void init abstract bipartite matching this ref inverse match this get problem get environment make int vector this nb right vertices 1
initializes the matching by building the backtrackable vector for the
public void set edge and publish int i int j throws contradiction exception this set match i j for int i2 0 i2 this nb left vertices i2 if i2 i this vars i2 remove val j this min value this c indices i2
when an edge is definitely chosen in the bipartite assignment graph
public void delete edge and publish int i int j throws contradiction exception this delete match i j this vars i remove val j this min value this c indices i
when an edge is definitely removed from the bipartite assignment graph
public void awake on var int idx int domain var v int domain var this get var idx for int val this min value val this max value val if v can be instantiated to val this delete match idx val this min value this const awake false
the idx variable has been modified awake the constraint
public void awake throws contradiction exception this propagate
no specific initial propagation awake does the same job as propagate
public void delete edge and publish int i int j throws contradiction exception assert 1 i i nb left vertices 1 j j nb right vertices delete match i j vars i remove val j min value c indices i
implement one of the two main events
public void set edge and publish int i int j throws contradiction exception assert 1 i i nb left vertices 1 j j nb right vertices set match i j vars i instantiate j min value c indices i
implement the other main event
public void awake on var int idx todo use jchoco method for printing constraint when it will be implemented logger fine awake gcc on var idx int domain var v vars idx for int val min value val max value val if v can be instantiated to val logger fine awake on var delete from matching idx val min value delete match idx val min value logger fine awake on var call to delayed propagation gcc const awake false
needs to be defined to update the reference matching before redoing the strongly
public void awake on inst int idx system out println this system out println this pretty set match idx vars idx get val min value const awake false
update the reference matching before redoing the strongly connected components analysis
public void awake throws contradiction exception for int i 0 i nb left vertices i vars i update inf min value c indices i vars i update sup max value c indices i propagate
performing the initial propagation reduce variables domain to the candidate assign values
public boolean is satisfied throw new unsupported operation exception all different is satisfied is not yet implemented
todo not implemented