|
From: Florent S. <se...@de...> - 2002-09-05 15:23:06
|
Hi
In WASA, there is no domain concept. You never write something like: x in [1..5].
The domain concept is replaced by the explorer concept.
In a classic CSP problem you need a specific domain for each kind of var: in
WASA, you need a specific explorer for each kind of var to do the same thing.
So, you can (and in fact you have to...) choose the explorer you want to use, for
each var you create.
There is only 2 ways of creating vars in WASA, both specifying an appropriate
explorer. When a var is chosen as the worst one during the problem solving, the
selected explorer is the one you've declared at the var creation.
Here are the 2 ways of creating vars in WASA:
1) use the VarFactory by mapping a property of your business object:
public class Queen {
private int line;
public Queen(...)...
public void setLine( int line ) ...
public int getLine() ...
}
then:
Queen queen = new Queen(...);
QueenExplorer queenExplorer = new QueenExplorer(...);
Var theQueenLineVar = VarFactory.INSTANCE.createPropertyVar(
queenExplorer ,
queen ,
"line" ) ;
As you can see, there is a specific explorer for this var.
see: http://wasa.sourceforge.net/content/cooksbook/index.htm
2) inherit the Var abstract class in order to map a more complex business object.
public class QueenVar extends Var {
ComplexQueen queen; //the mapped business object
public QueenVar( ComplexQueen queen, Explorer explorer ) {
super( explorer ) ;
this.queen = queen;
}
... all other methods to map the queen business object...
}
As you see... the Var constructor takes an Explorer in argument.
for the Var class, see:
http://wasa.sourceforge.net/javadoc-dev/fr/jussieu/gla/wasa/core/Var.html
the Progressive Party Problem uses this technique for the ScheduleVar. See:
http://wasa.sourceforge.net/javadoc-dev/fr/jussieu/gla/wasa/samples/party/
package-summary.html
There isn't a lot of doc about this...
Regards
The Wasa Team
> Howdy guys,
>
> Here is a question for you :-)
>
> I have a couple of vars and would like to have multiple exploreres, one
> for each type of business objects (ActivityExplorer, ResourceExplorer,
> etc). Is this possible at all?
>
> If this doesn't make sense to you (having multiple explorers) I'd be
> happy to explain what I want to achive instead, but that'll take me some
> time so I thought I'd start with an out of context question instead.
>
> Cheers,
> /Niclas
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone? Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> Wasa-users mailing list
> Was...@li...
> https://lists.sourceforge.net/lists/listinfo/wasa-users
>
>
|