设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13431|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 m1 C! b7 K  K! `; V1 a
/ [6 J+ M5 F2 p! w8 L
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。1 _5 F/ ~1 \% |7 B

  U2 U* f% o. Z1 _! lbegin P_read arriving+ o& n3 b5 o' R+ a2 `; u! b/ m4 \
    while 1=1 do begin. E' X7 k) g6 i$ f+ F
        read A_tote from "data.txt" with delimiter "\n"' m( O6 f4 M0 g; }7 ~7 S
        read A_time from "data.txt" with delimiter "\n"7 W& _/ q8 O: r% b2 }
        read A_leave from "data.txt" with delimiter "\n"8 |4 P  x1 W, @" I3 Q1 _+ M
        read A_picks from "data.txt" with delimiter "\n"
" {( S' z! K, W' S* x& _, E& I! A        set load type to A_tote
; c* G9 i0 q4 v9 t) F9 \' R        if A_tote="tote 1" then set A_induct to 1& l  V' q3 L% E; Q6 F$ u, P) z
        else if A_tote="tote 2" then set A_induct to 2
- K0 J5 Q; @2 p            else set A_induct to 3    5 B! ~( s! W' v
        set A_i to 03 e/ o! k3 t( `  U/ T$ x2 {- y
        clone 1 load to P_induction: T/ g) w$ t+ m
        wait for A_time sec0 N! X/ j2 ?  g3 P5 y. J4 u$ N
    end4 Z: s( Q3 j2 _$ e: U
end5 R) V  C0 n2 Z) D* H0 ]# o
  h  [. I+ F5 C1 a
begin P_induction arriving
/ ?% G$ p2 m1 U( y8 R4 O) _5 y    if A_induct=1 then clone 1 load to P_pick1% g3 m. S, E9 E* a, \
    else if A_induct=2 then clone 1 load to P_pick2! C8 V+ [! J( [
        else clone 1 load to P_pick3
/ V5 d, A" k3 x: Z+ D; Xend
1 W7 H# w, g9 W0 j" i: _" K' ?5 k2 V  }9 o/ X9 M
begin P_pick1 arriving
! V* }. z9 s9 X  ^( V    set A_i to 1  ]9 |7 y7 r& m/ h
    move into Q_induct1" G8 b+ X$ G% n; E
    move into pickaisle.induct1
$ z" m7 w3 m. M6 Q+ }6 y+ j    while A_i<=30 do begin
2 }, k- p) {- }, {2 y1 h        travel to pickaisle.con(A_i)
( Q1 r9 u; n8 F0 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 J' L- j4 K9 j5 K" l+ ~  K$ Z8 ]
        else wait for 10 sec
0 e6 d8 F& x6 t" w- K+ [        if A_i=A_leave then send to die% R2 h& V+ h5 _# W9 _
        else inc A_i by 1& `4 g9 E+ d' ^. n. H) o; c$ i
    end
: w2 V* c( y. O; T+ Fend9 b6 N- `6 ^. S1 U
% A  h  R/ {. ]# G. ]/ c
begin P_pick2 arriving+ U- v$ J( M8 S( I$ u3 I6 X
    set A_i to 11
, F* `2 J% F7 A4 K7 h5 `6 }8 E3 i    move into Q_induct2
- {0 Z) l% M5 k/ z0 p4 w    move into pickaisle.induct2
, |  Z- o: T7 z. R" A    while A_i<=30 do begin- m. p% _7 }& _# f
        travel to pickaisle.con(A_i)" Z  p/ E4 w3 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ `; H; M- U/ w- u) s7 L6 F        else wait for 10 sec0 H% b- P! p/ o6 u# E6 b7 }
        if A_i=A_leave then send to die
0 q6 B0 G* r& h8 w3 y- o% C( s        else inc A_i by 15 ?6 n3 s6 M: l) F% T# m/ y
    end5 m2 a) w! |4 K0 v. |( K
end' F/ x  u# {( W  }) p1 k3 S

1 v' x& q8 F/ v7 wbegin P_pick3 arriving$ r, V/ R) U, t& ?: R
    set A_i to 21
2 i( n" f; i# m    move into Q_induct3
7 F( d# {4 s$ J# {: X    move into pickaisle.induct3
3 m5 t0 M0 z- L- e" c    while A_i<=30 do begin# h2 B6 b2 O$ w
        travel to pickaisle.con(A_i)3 M. [" w/ A, G! E9 i' ?0 l2 `! O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' S. L" K8 R+ z9 l        else wait for 10 sec
# n6 X( l0 j3 Y3 L$ ^        if A_i=A_leave then send to die9 a  r2 J7 R$ r
        else inc A_i by 1
) U3 o# ~# x1 _$ v& ^2 f    end9 }' j: Y: ^2 C+ i$ G* o5 Z
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?3 d# _. V* W) f. {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 l$ ^( P. K/ [" ^) M7 V6 W6 J8 q& B$ I  A; X; q4 Z! f; w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- b% S( q- s8 d- ^3 W9 G, P" u& b* `8 x  {# ~7 y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 S; O" @1 x; U* q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) v/ p4 `7 k; Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 W) Y& Q3 w8 m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& I/ t5 _. X1 o4 w6 C& D8 n
begin P_induction arriving
4 o0 b0 k. j7 @! D    clone 1 load to P_pick(A_induct)1 k. ], R- m! w) I& F
end最大的系
: n4 z8 D7 W; _
& s* D3 \, e6 [5 f6 |( P% xbegin P_pick arriving+ R, f) a: i3 F1 H' B  y  f/ \
    set A_i to procindex * 10 + 1: K5 X, s: Q; {; _5 _
    move into Q_induct(procindex)% t4 r  r! Y' N: E2 \: P
    move into pickaisle.induct(procindex)
3 g. X% F# X+ W* d! f0 r8 t1 D    /*check the type of pickaisle.induct(i), for your last problem.*/
8 W' `* B/ a) ?/ \: M$ C9 H- d1 V5 M6 g5 J1 o
    while A_i<=30 do begin
% y( a8 @' i3 K' [1 n2 Z        travel to pickaisle.con(A_i)
3 h6 [; a& R8 a& ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ X# [6 e+ w& K+ Q! }: u- f+ }: Y7 L
        else wait for 10 sec
7 s$ y- ~# o# \( x. R1 Z        if A_i=A_leave then send to die
: ?  C* `: b- D' u( Z        else inc A_i by 1
4 N- H1 s- Z6 T( Z" W: R4 Z9 C    end
4 l( j$ w4 o* F, z, Xend  {& R# g; W5 D/ c9 h7 G7 w

9 C8 l$ s* x. \/ |* ?) n* @6 F  O9 \其中的procindex为整形,代表当前process的序号。: f) J2 E  m# N- D
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-4-13 21:29 , Processed in 0.019299 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表