设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12705|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  R; ]. z; c, Z* D4 x3 c" a

, _2 ~; D& }5 e: A& U" x0 U我的问题是,在每个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中的数值,不知道会不会有什么不妥。* Y# C# o' I  R3 A+ e& z" G3 v
0 D' m1 Z5 n, _; {; `
begin P_read arriving
  U/ Z( `, [  `, _4 W& s. O4 n    while 1=1 do begin
# y& r( z, P: Q( z/ a! i        read A_tote from "data.txt" with delimiter "\n"
$ E/ c; l; U% Q& q4 a* J" Y( k- Y4 W        read A_time from "data.txt" with delimiter "\n"0 m) i/ h- e' ]+ ]4 r1 g
        read A_leave from "data.txt" with delimiter "\n"- D" y7 H1 S" u' F
        read A_picks from "data.txt" with delimiter "\n"" x; [) X+ P( [3 @
        set load type to A_tote
- Q) e; P9 B5 m" {        if A_tote="tote 1" then set A_induct to 1% i, m6 Y$ W- X+ J7 D( D% G, R6 I
        else if A_tote="tote 2" then set A_induct to 2
5 X6 P; ~# a# Z  `            else set A_induct to 3    ; Y5 k/ b. U( o9 f( q4 @# N+ ?% O; l
        set A_i to 0
! z, {* l; V" ^6 M$ Z& @7 R* M        clone 1 load to P_induction
: @( s" s4 R4 o$ X1 j6 x" t        wait for A_time sec$ I3 i  y- `8 {* G
    end
& L( C/ r1 C; R! z/ Uend
3 z8 D6 t- r& J$ ^# M' J" J5 n; J& O( z, [) M
begin P_induction arriving+ R0 B% R" X: v) _. [5 l: k
    if A_induct=1 then clone 1 load to P_pick16 x3 {4 e1 }" M7 ]
    else if A_induct=2 then clone 1 load to P_pick28 K! t/ A9 C7 ~
        else clone 1 load to P_pick3- S3 X# U6 U& b, u) m: h! M
end; n; D* p! S5 N# E% N
: m) |: f; F9 L2 t1 `/ p
begin P_pick1 arriving8 B9 I, F/ A- V) L
    set A_i to 16 n: ]) ~  R# W8 p
    move into Q_induct1
0 N1 t1 a8 L2 y+ ]6 A    move into pickaisle.induct1
2 C2 x/ F* a8 d. F* u! k    while A_i<=30 do begin
- A: B: W  e3 c) K+ b, x, o        travel to pickaisle.con(A_i). n7 J. t4 z) F' q% ~3 A1 I1 S4 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 n  E# ~& U- N% Q
        else wait for 10 sec) }, s* I- [3 h! l
        if A_i=A_leave then send to die
, m( {  D# S/ d7 x        else inc A_i by 12 j6 e  a9 s* P1 z& Z9 Q; \
    end
& f# B" I2 N. l5 m1 }2 F7 Wend) D5 s! S( ]$ W" k( z; I- ~

' @) _4 N2 F4 S2 }# L  Ubegin P_pick2 arriving$ p6 t, u$ Y! k# V+ E
    set A_i to 11) m  e. W  M7 B7 Q
    move into Q_induct2
( ^2 ?. e1 Z5 Z2 r# L    move into pickaisle.induct2
- m5 M8 I  G7 T+ V+ E3 c    while A_i<=30 do begin
/ [. Q; X" {+ A2 S        travel to pickaisle.con(A_i): i' G: O# t/ a" c% A/ T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, o0 }( Y; I& }
        else wait for 10 sec
, t' e: r# Y' Z7 O$ @# Y        if A_i=A_leave then send to die
1 H/ }0 X. t! ]7 _; B0 Y        else inc A_i by 18 X! T2 a  @4 x# t+ {
    end
6 Z7 u+ C6 W3 ]end
! a; z9 P5 R( j1 ]) S& z" i8 K; z2 r7 D0 W- L
begin P_pick3 arriving
+ \" i" w1 G( D    set A_i to 21
3 }, a0 J- L' ^. {    move into Q_induct3
# x, U% n, p0 ^( M' u. k5 C    move into pickaisle.induct3
3 J+ |# y7 y/ w+ G/ E- z7 s' X8 b    while A_i<=30 do begin
( _/ d3 C4 W; A& K        travel to pickaisle.con(A_i)
4 F/ g! b; @7 w+ X) ?9 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 e1 @; W" S. B* |  s/ |& U3 h
        else wait for 10 sec
0 q! P5 P, r; P( ?/ {$ P        if A_i=A_leave then send to die
! N( U* {/ q/ _        else inc A_i by 1
4 G& J& ^+ O' @8 w- x0 y% V8 Q( u' ]    end
' f! m% b, o5 g" v; x0 D: iend

最佳答案

查看完整内容

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是个什么东东?
- N+ f- \! i+ S4 Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, H0 i# h& p$ ?: ^. @4 D0 Q
: o# g% c0 j" y2 T4 ~' D( w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. }7 r% t3 h% B' z& }

( M- I1 Z, H0 L/ _3 N% n& w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& l+ h; K& i% N1 m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; }2 Z9 Z8 f. o& W& u7 y% {1 ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& @  s0 i/ ^8 }+ {& A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 ]1 z6 e5 l- L# t3 hbegin P_induction arriving$ K: g9 P1 h: ?
    clone 1 load to P_pick(A_induct). ]7 R4 M/ O. A( z- w# g
end最大的系
' ]- L$ [* h) E- Z4 j) ^' e& [
# X5 l" K" O* ?3 f! Lbegin P_pick arriving
7 n# @0 _5 @4 ?    set A_i to procindex * 10 + 11 I3 X2 t7 U) v$ x* ]- z
    move into Q_induct(procindex)
' |  d* w3 e% I2 A: P    move into pickaisle.induct(procindex)0 S$ o( ]& L4 _& x4 d
    /*check the type of pickaisle.induct(i), for your last problem.*/& ^7 b, Z0 O6 j

, t- v4 P6 P0 J& I  P# D  r6 ~7 Z    while A_i<=30 do begin. I/ l: \$ a& [2 ]: G4 i/ D
        travel to pickaisle.con(A_i)% p) R9 d# H- P, w0 y5 S" j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, D: k# W& M* \* C, H. S        else wait for 10 sec9 [% U# z7 m) K) [
        if A_i=A_leave then send to die6 R8 E$ j) g4 D) w0 M" |- }
        else inc A_i by 1/ L% O* q; a: z0 c) P; H1 O$ f
    end
8 U$ M( a" W5 Z& T3 @5 l* oend
8 J+ i) [: U/ c  v# ]  `/ `9 G6 j9 S' H! [6 F2 E
其中的procindex为整形,代表当前process的序号。
4 _# @9 a) I( O* [0 I5 z% A  N: V  Lstation和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-2-12 23:54 , Processed in 0.014708 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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