设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14727|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, ]9 I/ O" Y- J, P+ X$ z: t0 [- i2 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中的数值,不知道会不会有什么不妥。
. ?' ]7 y4 L5 R3 I* P& X, L) i: P: w. b, y6 g
begin P_read arriving" }5 @* l# I: `
    while 1=1 do begin* B7 A# s0 b8 z
        read A_tote from "data.txt" with delimiter "\n"7 Q8 d  I! |) }: Z6 x4 i
        read A_time from "data.txt" with delimiter "\n"7 |9 d9 s$ j* b4 X* [, o( P2 L
        read A_leave from "data.txt" with delimiter "\n"
5 D$ A% Q' Z2 ^0 ?8 b/ q- I        read A_picks from "data.txt" with delimiter "\n"
6 F8 p- K: R7 p9 R        set load type to A_tote2 L2 Z' F, `* W+ p1 g. R
        if A_tote="tote 1" then set A_induct to 1/ o8 O  |* @- g' m: [
        else if A_tote="tote 2" then set A_induct to 2
& @. s' ~5 |- _0 ?, M2 D            else set A_induct to 3   
8 R& A% g1 F1 U) s; d        set A_i to 0
+ B* y, o$ p! h: i4 b9 f6 K% h/ M0 n        clone 1 load to P_induction
; \  |' |; ?" S/ B, O! e3 r/ [        wait for A_time sec
7 d. d) D2 h: M" K; S& U    end
1 A) a' _6 @) }4 \8 D3 Q( ]9 Dend2 Z9 f5 U9 K/ c8 |# ?

, r- f) ?/ N: ?- J- O: F/ O! U: Xbegin P_induction arriving
1 \2 \% O6 d" O' L9 g9 E+ y    if A_induct=1 then clone 1 load to P_pick1
' z& a3 @2 L- y  p: Z5 B# r; w: }; W    else if A_induct=2 then clone 1 load to P_pick2
' Z* D* A# w7 ]/ s        else clone 1 load to P_pick3  C) b) {& P- E; ]6 M
end! B: [2 Q' \2 P' J. Z
7 |. u- n0 {7 X6 b" k, `! l
begin P_pick1 arriving  T1 w& [0 T0 L  R. U' }
    set A_i to 14 w: ~4 `( e9 C( D8 m
    move into Q_induct1' P) H0 \: M. t& o8 I# {
    move into pickaisle.induct1
! f7 |. X4 l/ {, f6 ^, }    while A_i<=30 do begin
+ y6 ]5 P+ k4 K; X" l$ Q7 A5 `% x        travel to pickaisle.con(A_i)
$ L9 v0 r" x/ s/ b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% H7 k+ h! T- V! g/ o
        else wait for 10 sec
, n0 b2 P# n9 F. h  s- @- v. p. q0 ?        if A_i=A_leave then send to die- q7 G: B5 s" X7 d2 c
        else inc A_i by 10 s7 `9 }# [3 d  }6 ?+ {9 e$ a* @
    end. f5 [$ E0 p8 M/ ^: `) k. b7 W
end
4 F7 k5 X- f/ @4 V
, D" R  y9 p  Q4 k) ]begin P_pick2 arriving, U# u4 s  r* B/ \% ?# {8 B5 M- z9 x
    set A_i to 11" t6 r, H; Q  `
    move into Q_induct2
3 P) N0 k4 v! j6 s$ c    move into pickaisle.induct2
- d5 V6 ~7 y0 N/ E: m; q: ~    while A_i<=30 do begin3 l/ Y( m6 `0 C' j0 z6 q% S$ I
        travel to pickaisle.con(A_i)
& e0 J! W8 V- i3 D9 r: Y* D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; d# j# d+ Q8 u  k. T7 y
        else wait for 10 sec. }. A" L1 S' b: {/ a8 b
        if A_i=A_leave then send to die* t& i; M% @" z& i8 x$ X% }5 i
        else inc A_i by 1
. n  I, N( k5 I+ B9 r    end
6 S& H0 \; K6 E4 T& Hend1 u, x% ]+ h' x
! ?5 J& J' }, o8 C% A% q
begin P_pick3 arriving
! ?' ]7 C7 E5 Y& L& g0 c6 F    set A_i to 21
6 [! ]7 T% \; E; _' T    move into Q_induct3
/ x% n/ s5 j! t; x7 H, V1 c    move into pickaisle.induct3
& ~% ?/ \6 T% F- d  `! h5 J    while A_i<=30 do begin
$ P) {" F5 p/ M+ U' h7 O, n& r        travel to pickaisle.con(A_i)
1 t! L4 g4 l9 F+ H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, d3 H8 q/ F9 p. D  l3 I
        else wait for 10 sec) m- `1 o; }8 X
        if A_i=A_leave then send to die
0 j$ a% m+ R1 a" u" H2 O5 B2 ~+ ^  ?        else inc A_i by 1# w" k! w& s8 i6 e; b; T
    end
4 y! y* W& c5 e! qend

最佳答案

查看完整内容

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是个什么东东?
- |0 ~. G- C3 o( ?2 Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- ~% {& t/ C: M  }4 `: j
" F& a: _( A# b& q! |8 A# bAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' b4 y' x5 ^/ |  F( Q5 S6 `) h5 K
/ ^$ m- c. Z% N: P* x* t
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ R  [; P* X# N* t' y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  K9 m0 @$ w, U0 a9 U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 w7 g: s. W% e6 s# `2 r5 V7 r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ h1 J; P1 p, t) [5 }- x6 |9 lbegin P_induction arriving
/ r' I! U- u3 a' e, k; Z    clone 1 load to P_pick(A_induct)$ D3 c+ S# S+ z+ C; {# G( L, N
end最大的系, G# ]6 T+ l2 ^% {4 G

4 w+ o6 v; I2 {8 m. K- ]5 }begin P_pick arriving
3 a. x3 W" ?$ Z7 K) J/ b    set A_i to procindex * 10 + 18 ?( g( f0 I6 l. y5 t2 j' I$ S
    move into Q_induct(procindex)
; _3 `: ~7 x7 S* W7 E, _    move into pickaisle.induct(procindex)
/ u' N4 v% L- e  u' M. x7 ~    /*check the type of pickaisle.induct(i), for your last problem.*/
6 r8 D; @- x: ~, K" F8 M* C  x5 D& `
    while A_i<=30 do begin
/ }0 s' k; w; @! T" Z) a0 S/ G        travel to pickaisle.con(A_i)
* Z5 D; Q' x, ?& c( v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! X5 R9 F3 H5 k# w3 h% R/ R        else wait for 10 sec
) n$ ~7 z5 K$ u8 Q5 t; }* r        if A_i=A_leave then send to die
0 W; b3 h# e! y5 }7 c        else inc A_i by 1
9 h! _  Y6 T! e2 `8 a    end& K& ?% r+ u3 O
end
/ X4 `& ^; M1 t+ C$ d* g# o( U5 k. e! o( A! ~
其中的procindex为整形,代表当前process的序号。
! J; l9 `0 I$ ?2 A+ Nstation和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-7-23 11:12 , Processed in 0.013722 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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