Hi,
Using Enterprise Library, is it possible to change the shape of entities while it is acquired (i.e., it is seizing some
resource)? For example, suppose you would like to animate ant legs while it is moving through a
conveyor animation guide shape.
Pavel — 15.05.08
Please try to use the approach that is described in another forum topic:
http://www.xjtek.com/support/forum/anylogic6/303/
So when an entity seizes a resource you can execute this code and e.g. change entity's color.
Jose — 15.05.08
Your message:
It isn't the thing, what I'd like is to change the entity shape (probably a lot of times) WHILE it is seizing a
resource.
Pavel — 16.05.08
For instance, the entity animation shape is an oval and we want to change its fill color from green to red while it is
in the "Seize" element and then set the default fill color. So we should type the following code in "On
Enter" field of "Seize":
ShapeOval ov = (ShapeOval)entity.getShape();
ov.setFillColor(red);
And in "On Exit" field type code like below:
ShapeOval ov = (ShapeOval)entity.getShape();
ov.setFillColor(green);
So the entity will have a special shape (red oval) while it is seizing a resource.
Jose — 16.05.08
What I'd like is not "the entity will have a special shape (red oval) while it is seizing a resource", as you
said,
but "the entity (suppose an ant) is changing its shape (between a number of shapes, for example with different
leg positions) WHILE it is seizing a resource". I think a possible way is, by using,
. . . EXIT -> process object (with SD + DE to shape changing and moving) --> ENTER . . ..
Jonas — 16.05.08
Hi,
try to use parallel to your origin line a second line, which is only for animating the moving of the entities. In the
"On Enter" field of your conveyor type a code which inject an entity in the second line. Now you can animate
an object in the second line while your entity is in the conveyor of your origin line. When you fit the time your entity
is spending in the conveyor (origin line) with the "life" time of the second entity (second line), it looks
like that the animating object of the second line belongs to your entity of the origin line.
Probably it sounds a little bit complicated and it is also extensive, but I`ve tried it and it works.
Jose — 16.05.08
Thanks, Jonas!
I'll try, it's probably more efficient than using EXIT -> (SD + DE)object --> ENTER , mainly to cope with a lot
of entities.
Jose