设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15194|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# O+ _8 t% f: X1 T& J. t. @5 B+ ^# V# M# o, _" i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ m; \7 r9 |8 ~* a2 M

" K4 b+ t7 r% K$ zbegin P_read arriving
' [  D: n& H# J1 c. t    while 1=1 do begin
& K9 y4 b9 ~+ k* i. v        read A_tote from "data.txt" with delimiter "\n"
5 q; t5 }) K; @        read A_time from "data.txt" with delimiter "\n"8 R9 _* M4 g# M; J
        read A_leave from "data.txt" with delimiter "\n"& {. `2 V+ a! T0 v! @1 S2 I7 ]
        read A_picks from "data.txt" with delimiter "\n"
- z$ [: [' Z7 r; W        set load type to A_tote: J# C2 R/ a+ N7 C9 E# @7 h
        if A_tote="tote 1" then set A_induct to 11 k( {) \/ H+ ^
        else if A_tote="tote 2" then set A_induct to 2" P8 \& M3 j/ L5 d4 f- B+ p
            else set A_induct to 3   
$ P* A5 p# |6 Z8 f1 b        set A_i to 0
0 W+ p/ P1 T% y7 ~$ M' r7 r# u        clone 1 load to P_induction3 G9 K  c9 D; `1 p
        wait for A_time sec
7 ~4 P' k  c) G) n  z) y- I    end
$ o3 N& N) ~( U# g& m. rend
7 B/ t% S; Z3 i" e+ o6 q; s6 G7 r* c# _1 U
begin P_induction arriving
. I- D1 g  f: L2 b  ?6 v8 y    if A_induct=1 then clone 1 load to P_pick1) U6 [0 p* e- ^  w
    else if A_induct=2 then clone 1 load to P_pick2
$ g' ]8 P1 t8 w- u' p' w2 j2 D        else clone 1 load to P_pick3% T; O5 T2 J5 V+ H
end
0 s" {# O7 e. n/ w# s; X7 R6 N& g9 K1 r* M! b
begin P_pick1 arriving& X' E2 m1 |1 d& J4 D3 A
    set A_i to 18 ?  r0 t. c: V' L' ?. B
    move into Q_induct1
& g  e5 {" H% q1 {* K0 l    move into pickaisle.induct1
4 w2 j  Z) `! D# a2 Z  |$ I! c    while A_i<=30 do begin
; r; V* c, ^, Q        travel to pickaisle.con(A_i)
+ w  Y7 P8 L$ x& V+ \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 O: b# u; ]) a& E. ]# M        else wait for 10 sec
- ^- u) t# G$ C  n( w, r        if A_i=A_leave then send to die
+ P( u/ q0 R# j6 l) M        else inc A_i by 1
2 c/ o8 {: @( B: r8 N  C    end
5 p0 |' h$ Z, V2 Send& d, E' h0 [. p

. I2 H& ?0 J, x0 B( \begin P_pick2 arriving
9 w) O7 z# Q6 H    set A_i to 11" B& v1 W) [6 [* k9 Q
    move into Q_induct27 {- X6 K4 \4 P5 g- T/ w$ C9 J# Z
    move into pickaisle.induct2
# w) H9 \' z1 b, z; x# _    while A_i<=30 do begin9 }6 ~1 i2 ?8 N5 e) n+ A
        travel to pickaisle.con(A_i)! h, C2 C- r" a! K) b7 _" l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: _, S% `6 e! n! q- @        else wait for 10 sec
: g3 |+ b7 K+ B) n        if A_i=A_leave then send to die
0 c8 }4 j+ q. X4 p# O        else inc A_i by 1- X: x# K2 E7 C5 _2 ~
    end
8 O" J8 S5 p4 `2 M+ i! ?" Uend# F* D" N) G4 L* Y/ w! i$ T
, y6 e' V( N8 F1 V) K  M
begin P_pick3 arriving
7 O: l! r) b$ {' H0 j    set A_i to 21
1 P3 |2 Z8 J% F, b# k+ p7 n+ X    move into Q_induct3
4 ?7 S1 V+ h9 C5 x    move into pickaisle.induct3
; r! Y* }: x: R4 a6 Z    while A_i<=30 do begin. x  G- w. W2 J7 n7 w$ N# D
        travel to pickaisle.con(A_i)3 Q, o: f, V* z, g0 C8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 L- d% L" |" o' b        else wait for 10 sec; ^0 O5 K6 b5 j9 F' G; D
        if A_i=A_leave then send to die
5 s2 o3 L4 Z% L! }6 A. R( O( _        else inc A_i by 1
, M" r/ W4 ^: e8 D! x, G4 u, T    end" n& g  O: F6 d4 R/ z9 g+ E6 b
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是个什么东东?
: v# R. Q) A6 I5 |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 y* H3 q, ^6 I! E# V
6 f: G5 T! K4 V! J- f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- ?2 F! _" L0 g# ^, X# J* ]: }4 \; N/ c& j/ w# p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( L* S0 @# m( [2 S- A% C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- J3 x' \3 I% J+ Y4 H# d" D7 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ D5 g" _( L# ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 T) F# M- {, Z- p& I0 cbegin P_induction arriving  Z) u. S: G" O7 |0 w$ g
    clone 1 load to P_pick(A_induct)
1 k+ A# x- |1 `. Zend最大的系, x& L$ g+ X, m# a
( `2 O5 q: F" q! f: C) T% g
begin P_pick arriving# @- K! T  ?& q9 S$ m
    set A_i to procindex * 10 + 1" k+ H4 {1 Z  R9 e& ?+ W* t
    move into Q_induct(procindex)- ~+ W! }7 T5 |% x$ a. c& t! }7 g
    move into pickaisle.induct(procindex)
1 u5 S, k5 [' m3 q    /*check the type of pickaisle.induct(i), for your last problem.*/9 y  Y) j" m1 u, Z
8 H- A8 a5 Y  X" D- r
    while A_i<=30 do begin
3 U& k" S/ n4 @) }: H. @9 G* G        travel to pickaisle.con(A_i)  [/ i  `9 H3 d( i4 M0 x7 S0 W* z( x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) C$ [, M& J) A3 z- e# o- X        else wait for 10 sec
  B: ]1 k  }9 S( ~) V1 ~( B" l# V        if A_i=A_leave then send to die
( d" h+ d3 }. n+ c, q* Z( F        else inc A_i by 1( K8 w- H5 ^% _
    end) V8 q! T! Z4 N
end+ Z/ G' P8 p* L4 o- t% ]
" v5 ]  Z5 t/ t& f5 X6 p* V5 S
其中的procindex为整形,代表当前process的序号。
3 j& {3 d+ ~; c1 D8 O7 wstation和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-21 22:43 , Processed in 0.014205 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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