设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13847|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  {6 D! u' I# W. [% I+ @; p) A' W% ?
4 h; R/ o3 ^) [1 i4 I- X' B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. }& z3 O7 V4 J

2 P, V' {4 _" Wbegin P_read arriving
- s4 Q) w- X; X8 \    while 1=1 do begin2 I+ y4 Q$ H$ p8 v) I7 g+ q. u
        read A_tote from "data.txt" with delimiter "\n"
9 P0 Z) u; `7 f        read A_time from "data.txt" with delimiter "\n", J) k8 V" u7 Y9 S4 u
        read A_leave from "data.txt" with delimiter "\n"# c8 v6 g8 ~" R( u+ n  d$ ?
        read A_picks from "data.txt" with delimiter "\n"5 m3 V+ O* a6 V2 l
        set load type to A_tote/ ?$ x8 ?- C2 v. Q* Q: c/ Q
        if A_tote="tote 1" then set A_induct to 17 ?% ^% R6 w: ]- f
        else if A_tote="tote 2" then set A_induct to 2
$ T- G# ]" f7 _5 m6 O; P& D            else set A_induct to 3      s3 I, R  W3 p4 \, Q
        set A_i to 0! |, r. L/ q+ W$ C/ b; \! j' z
        clone 1 load to P_induction
5 ]  W9 J2 v: n. [& E. n9 i        wait for A_time sec
" W& S1 P! u- ?: t2 E. d. L    end" h" q* W5 J. l- l6 C
end8 [0 d& |: y: W) S" g

( P% u2 G0 W9 |# M5 F- M' Ubegin P_induction arriving
/ Y' n; h1 K, |! I7 e$ ^    if A_induct=1 then clone 1 load to P_pick1
% k( E' x. `$ y% S+ l    else if A_induct=2 then clone 1 load to P_pick2
! \) h" }. U6 Q; w9 f# J        else clone 1 load to P_pick3# D# s' n0 j5 o: v$ q; U6 B. S
end
$ p  [, P2 n6 E9 Q$ b1 U: C. [+ x) \; _6 A# F9 ~! o) D! ?
begin P_pick1 arriving
! `7 a$ g. |5 g: B8 S    set A_i to 1, `1 Z- L2 x$ x9 [
    move into Q_induct17 u2 q/ u0 U% X) Q8 Y- j3 C
    move into pickaisle.induct1' f( X- m$ V4 n
    while A_i<=30 do begin5 B, X/ l  D. [3 U
        travel to pickaisle.con(A_i)( P, @( F- d" h* z* P0 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) y& j4 U9 ]9 F5 L) v
        else wait for 10 sec
% z/ O7 |- E" i+ {3 E4 o* ?1 u        if A_i=A_leave then send to die
/ b: f6 Y' l  L9 f5 l7 ]. r3 G% I        else inc A_i by 1
* w5 q3 x( g) |7 }; P; p- h    end5 b5 ^) ]8 c8 ^+ P( C
end0 L/ z# D. j( r' F! x+ }7 _( u
1 o; B+ r9 g, x" k8 Q% q8 S# p" U% S
begin P_pick2 arriving8 M/ G1 k4 j- L
    set A_i to 11
3 a% [5 _8 \" {* S& B8 N8 o! \5 ]( R    move into Q_induct24 N+ p! `; Y, Y0 g" U3 w3 l6 q* {
    move into pickaisle.induct26 s1 s3 S1 r* g& M% [& _
    while A_i<=30 do begin( Y$ ~# y7 v4 X
        travel to pickaisle.con(A_i)' J. G5 V9 n' [; l* j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 l1 ~' P# P9 N/ U( U        else wait for 10 sec
8 v/ O% Z5 E( K/ B2 E4 C- \3 f, n        if A_i=A_leave then send to die
# N" N0 |/ M+ u+ }# V- T8 Q$ M: M        else inc A_i by 1
+ W- t1 ?1 c) q. Z0 M5 Q7 L    end
( c9 C& R9 A/ e3 M) [end  ], k2 f. e3 K- ?! l

7 f$ C3 J7 x* j, ^begin P_pick3 arriving
  ~; @* H6 K( H2 A: p    set A_i to 210 M# @- r0 z2 ^4 y
    move into Q_induct3
% j- B* _. ~6 n& B# p$ ~: D2 U8 b( m    move into pickaisle.induct3$ H0 A* F" m) @8 h1 L
    while A_i<=30 do begin
1 s& b# I" G- y1 C        travel to pickaisle.con(A_i)
7 i! m) m9 g/ S5 W! N6 H; B8 t$ e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 M+ |) |; Q. U* I: ?7 Y
        else wait for 10 sec" g- k* r: P, v! O0 k
        if A_i=A_leave then send to die
" V( r1 j7 y; L6 {5 l2 G        else inc A_i by 1, Y- W# x3 g8 p9 r9 F
    end
5 i, C% c7 C& A: m/ L5 [2 U3 Rend

最佳答案

查看完整内容

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是个什么东东?
6 ~, y( k( t+ xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 V' o: e, N% V6 t6 u0 B- g5 _/ R, b& n2 n: v8 k4 E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 ^* ?& K* K. l. h2 I4 z+ N- q
6 Z' S/ _! ~, y5 V$ |2 `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% x" E- t2 i+ i4 }( R$ Q2 z0 T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 x8 ?4 w% _& m% G1 `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' h4 r( E  Y# y) D2 v, V0 |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ E( U$ ?" Z" ~! z* @begin P_induction arriving9 z& Z5 {9 c7 i/ O) @
    clone 1 load to P_pick(A_induct)7 I4 I  ^' C) n2 E
end最大的系; }% Y, l3 l5 m9 p; R+ w

! e' F+ M1 m- k- X2 rbegin P_pick arriving
9 o- P- g& O4 {) E/ U    set A_i to procindex * 10 + 1' ~0 G% e' E1 n
    move into Q_induct(procindex)
- M1 ?' I$ R, @' R: M- Q    move into pickaisle.induct(procindex)
* k: @; G# p* |4 N, y    /*check the type of pickaisle.induct(i), for your last problem.*/% G) q9 }' r0 p

$ t+ o5 m9 q8 C% D  j/ S+ J9 Y/ z    while A_i<=30 do begin  T) J3 l: f- m) p  m5 J
        travel to pickaisle.con(A_i). E' \9 V% d1 N. G$ F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 Z, A$ Q! b) i, V        else wait for 10 sec
7 c, m- u7 h4 M/ ?- X5 ?        if A_i=A_leave then send to die
0 J% E2 O$ O7 i- _* \; U) I& D$ Q        else inc A_i by 1$ [0 L& E* F" [4 g
    end
$ v5 V; D- {( Z: t# wend
  B# w3 M" m  W5 |4 c+ g. c2 b2 @4 K) o5 N/ R/ ~. M+ P
其中的procindex为整形,代表当前process的序号。
4 K0 y) b/ t3 P9 L6 z6 k) rstation和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-5-12 18:23 , Processed in 0.018502 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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