设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15157|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 `0 H% z3 Y  h
- `4 O0 P# P, ]9 l8 {6 t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: }+ N( n2 f) N# u; m
# d/ t4 ]) b  T& l2 E; r
begin P_read arriving( q! u' n. T+ u" _
    while 1=1 do begin
* D8 d' }: C* o2 Z+ q3 b        read A_tote from "data.txt" with delimiter "\n". G8 ]) a+ n: |  x2 V: f/ ]
        read A_time from "data.txt" with delimiter "\n"
9 K: ^! ]0 H  B4 x& v0 w        read A_leave from "data.txt" with delimiter "\n"+ U: k! r; b: K% p
        read A_picks from "data.txt" with delimiter "\n") w- W# i' Y  u! v, y0 E/ `# Y
        set load type to A_tote3 p, x. R+ I1 @  p& ^  J8 w
        if A_tote="tote 1" then set A_induct to 12 }. s; A- Z. g! H# v$ u0 x! d! W0 P
        else if A_tote="tote 2" then set A_induct to 27 H! K# \; `  t9 }9 T/ K8 a
            else set A_induct to 3    8 a0 Y* Q2 p, n3 k7 ^/ ^% j
        set A_i to 0
9 E8 O& ~( D. F  U        clone 1 load to P_induction4 w/ _: l! W% E" v& E% G: F; I" X
        wait for A_time sec( |5 Q7 J7 V) \9 c, n0 P+ [
    end% V2 T/ V- K" ^# X& h" c+ w+ i
end$ _/ a: S6 T1 h% _8 Q; Q

# p5 H. \$ i& k6 dbegin P_induction arriving6 \- @( Q* G" [4 T2 u5 p1 K
    if A_induct=1 then clone 1 load to P_pick1" z2 f! W: r% W) r- D- P9 D- S9 ^
    else if A_induct=2 then clone 1 load to P_pick21 h* N4 j, F: _
        else clone 1 load to P_pick3! j9 M9 k+ H& d  S0 P4 x) d' T( [
end- U  l' }" A2 Q4 }5 T, ~7 L- d
7 j, z/ U- B' a! G: [0 [
begin P_pick1 arriving5 O. G) Y3 P8 T
    set A_i to 1: y5 j( L; L# f) Y$ Z! {0 H
    move into Q_induct1* I+ L8 A% l! I3 x6 t& ^, w! s- ?
    move into pickaisle.induct1
* @. {6 f% u* Y    while A_i<=30 do begin
( C* X$ T0 c8 {' m        travel to pickaisle.con(A_i)
7 s; l$ v- A$ w4 D4 N" d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 p9 Z! M' S1 @( d; G2 c        else wait for 10 sec
& V% c0 E# ], _        if A_i=A_leave then send to die
6 ]$ Q: n8 `9 E/ e+ ~        else inc A_i by 1
- _5 m8 ~% U9 S/ r4 y) b- V8 H; o) n    end
! m3 e* N" U$ l. ]5 xend( u# `) m( J' _8 z) b

- _# u& S3 w" H: s  |# E$ ^4 pbegin P_pick2 arriving
! }  @3 H( G4 t3 }- D2 f    set A_i to 11
- p& ?  v4 M" n$ g% O4 B( b4 U    move into Q_induct2
. W  ]" A) `1 V- i3 H    move into pickaisle.induct2
( Z& _6 m1 t# h, ]1 F. E3 y/ s    while A_i<=30 do begin
/ [$ R# E9 }$ j4 S# n        travel to pickaisle.con(A_i)
  V- k! L. m- @! A8 N/ D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& n  W- v' e2 L, d; s& i* ?        else wait for 10 sec# v/ D, h8 q8 u* B8 [% |' T
        if A_i=A_leave then send to die
# ?8 H. U5 T, v7 n9 t# w. s- H, ~        else inc A_i by 1; T( a  K7 F! ~9 t* S: M
    end* u6 g9 b1 Y: B2 _2 n
end
7 v" J2 J0 A' a, N- Q
& H9 R; w- t' u3 L3 j+ d  a# Sbegin P_pick3 arriving- Q, n/ @+ Y( X# i
    set A_i to 21
, i0 E6 e) T6 k" E    move into Q_induct32 _8 w7 D7 M6 ~5 ~6 x* ]4 p8 r
    move into pickaisle.induct3, O( K( {8 i$ ]) n
    while A_i<=30 do begin
  q) U2 d0 v/ q7 K! y        travel to pickaisle.con(A_i)1 J9 p3 }8 x6 M; |: H0 @5 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ^" U4 h7 v+ a0 ?        else wait for 10 sec
2 b, ]4 l/ |3 N5 }5 P        if A_i=A_leave then send to die
' n  B% J! V( {3 _* i! x( }4 ^        else inc A_i by 1
8 e! p+ R* ^7 E4 D    end/ ^# Z$ t% |0 r/ G0 I' {
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是个什么东东?
$ y: \5 q2 p5 m9 I; ?' Q9 Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# R* U0 v% ^& e; c. H. G9 R* j

0 e4 Q6 c3 d4 R7 |" D/ nAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 ^, ]& _8 ^4 L  S( C
( B, |# d& e0 {7 S# n另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 ^9 ^& Y, Z! b1 \, M' p! @; Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 G2 V* ], c5 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 H. t9 D% I( n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% h6 e+ C  |' }: f) T- pbegin P_induction arriving
; q# p. d" i# V; Q8 J    clone 1 load to P_pick(A_induct)
% S) r7 I5 K0 g" Z1 K2 S. S1 }end最大的系, ^0 o' |2 t' Z) U/ o( {3 `0 u, H! F
+ m% h8 w, ~0 r" P; F  R
begin P_pick arriving7 _. ?( ?( k+ c
    set A_i to procindex * 10 + 1
# F: d. d( i6 G  T, A" q) ]    move into Q_induct(procindex)2 Y. J  ~; ]/ ?0 A
    move into pickaisle.induct(procindex)
, L- ]' n" `$ l4 L. I    /*check the type of pickaisle.induct(i), for your last problem.*/
: k- A0 |! r1 U/ [5 F* C6 E4 ?- g: y  u; H( c( o9 L+ z
    while A_i<=30 do begin: l' U$ Z$ J" Q+ K9 N
        travel to pickaisle.con(A_i)6 d  d4 ]8 o, G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! X6 A5 ^5 M; A$ w" F1 {! v        else wait for 10 sec0 t9 K. R+ ]8 g1 m+ M
        if A_i=A_leave then send to die; {$ V6 M$ ?% J. ^
        else inc A_i by 1( }2 r% q) D. v; X
    end
3 F# O. O9 v2 J8 `  Vend
$ B3 s9 x$ v. k- A) N4 z0 j
; \% p9 g. Y- B$ m$ l0 B其中的procindex为整形,代表当前process的序号。& D7 f5 M4 b* h6 L, g& c& H
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-8-16 20:22 , Processed in 0.022797 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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