设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13569|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- U# y: F3 q4 x, K/ M

3 w# `1 f+ p3 r& {5 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。, Z" s* d9 G& J5 F- x4 |3 r. b% U

0 }1 {; d* |, I! j$ b6 rbegin P_read arriving) Z, M4 D5 u  x/ H' y% I
    while 1=1 do begin
+ u) E" N+ ^8 c" k' I1 w! t0 o        read A_tote from "data.txt" with delimiter "\n"0 I2 {- e0 k% }7 j% T
        read A_time from "data.txt" with delimiter "\n"' r3 t6 I# |5 S) `5 d
        read A_leave from "data.txt" with delimiter "\n"
$ I9 b# O0 V8 C, G2 R        read A_picks from "data.txt" with delimiter "\n"7 l) K* n* W, w$ m
        set load type to A_tote; ^- g0 Y9 s: d7 e# {
        if A_tote="tote 1" then set A_induct to 1
9 I9 n' q: a1 @5 R5 G; s        else if A_tote="tote 2" then set A_induct to 2/ P: ]8 ~0 \, e: W! F
            else set A_induct to 3    3 N  ~" d5 y" N
        set A_i to 0. s. ]2 r0 k' S2 K
        clone 1 load to P_induction
0 m- [- R3 C8 \+ L7 y+ I7 u        wait for A_time sec" g9 h/ ?" l' j! Y1 h: ~3 W
    end. S  n' o* F- Q
end
+ I! C$ j$ s, s6 q. O9 G( d$ M  O3 t" J. v4 k5 R5 X  P# e2 A  y
begin P_induction arriving
+ n9 m! @/ o$ r# l$ S$ Q/ e    if A_induct=1 then clone 1 load to P_pick1( h! V8 a+ }+ h9 ^: h* D  [
    else if A_induct=2 then clone 1 load to P_pick2/ ~/ w9 u+ h8 A: e
        else clone 1 load to P_pick3
8 F7 z8 w# L+ d' l( @end6 q) H( _% W" j7 Y. @7 @

' b0 C5 P( Q5 b) ^9 p7 jbegin P_pick1 arriving
9 p, s" A; h2 I/ h    set A_i to 1
8 l* {& z& K. M$ V/ W2 y    move into Q_induct18 E+ p& j) }& L9 W' e# s" \
    move into pickaisle.induct18 X8 u+ J, c; B1 o
    while A_i<=30 do begin4 c: C! A$ S/ q5 l! y
        travel to pickaisle.con(A_i)
5 K& l0 F  n. a9 x8 V1 @7 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?7 b' |3 s7 X, ?7 P" _$ ?0 }  K. m        else wait for 10 sec* p3 [; T4 s1 p0 ^4 L
        if A_i=A_leave then send to die
+ P' z9 B. q! t; J; e        else inc A_i by 1
/ W" W/ C8 {' p: ~) w9 j# Q    end8 x1 u& Z/ F: [! P% d
end
% ^/ f! K: \. @, a& [5 }; Q* H3 A+ F$ o
begin P_pick2 arriving
) G4 S, c# n: x5 v    set A_i to 11
* Z% c. K! J2 x    move into Q_induct2
# T  Q. P9 J6 \% h2 C! s7 Y3 k    move into pickaisle.induct2. A( d0 \: Y* T  N' u! B
    while A_i<=30 do begin) `6 h( J4 p& @; s
        travel to pickaisle.con(A_i). z+ G$ E$ s8 c3 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 B  I% @! x9 _$ i" P  I8 h        else wait for 10 sec
0 Y; B' r3 s' ]" i7 c+ k        if A_i=A_leave then send to die3 v4 I1 R: Z8 r
        else inc A_i by 1
+ o0 f# [3 v& q! F1 |& t- ?    end
, d; |! \% X5 E( n& C( ?end
& B$ K) ~9 J; z* P9 {. S& h) S# H  \0 \2 l2 z- l) \+ `. S
begin P_pick3 arriving& c' t/ T  H4 T; D
    set A_i to 21, W9 g4 d; {/ i
    move into Q_induct35 `8 V: d+ F9 I  b
    move into pickaisle.induct3( }2 m/ D9 s- T6 L- `
    while A_i<=30 do begin
1 A. m; n& r2 U/ v8 u. J5 Q        travel to pickaisle.con(A_i)* T/ m0 K, K' D2 o/ P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H$ M9 H& q5 {9 b        else wait for 10 sec
7 v* s" V& _* G  q' d* G        if A_i=A_leave then send to die
9 g0 j. k" _: ^2 f/ G" a4 w        else inc A_i by 1
! P9 }, ?. \1 [, \- `4 N& e: N! v    end
. J8 d2 i- e7 T5 T  ]; E- j  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是个什么东东?9 z* R. d5 |* w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. I* }9 E- U$ F. c5 \1 S$ Y, G
) B9 @" C5 x8 K7 J  X# r1 d3 U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ x$ v2 g# \$ B7 ]7 A" @

3 B# V, d8 O1 L, S3 h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 J9 X/ |6 C4 w, Y' V) f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ ^  n! ~' E3 |3 t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 ~2 S9 \! J0 F9 P) R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 k8 U1 B8 u. C
begin P_induction arriving" P. @& x$ Y' H$ g5 B3 ^1 ^. z
    clone 1 load to P_pick(A_induct); t* e* ?1 b4 Z: q
end最大的系
5 S) S, b) z5 B6 @$ g0 |$ z7 [
) k- m8 J5 c$ p0 h' a6 Qbegin P_pick arriving
% Y/ k* p# j6 x8 m3 Y+ k4 B    set A_i to procindex * 10 + 19 U9 d+ T/ j- K5 r1 d
    move into Q_induct(procindex)2 S$ k4 j1 W' l4 ?2 E) `
    move into pickaisle.induct(procindex)
# r0 c7 J$ U+ J, q' Y    /*check the type of pickaisle.induct(i), for your last problem.*/3 J8 Z3 s) ]) Y! z/ d: H
' B+ p8 R. d' g0 c' M( x
    while A_i<=30 do begin1 `9 Z( Q1 v; q) d. c0 f6 c
        travel to pickaisle.con(A_i)
: c' J1 M1 d; x6 E, N2 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 x+ n$ q/ \% n# p        else wait for 10 sec
3 z: {" [! d7 O0 M+ C; J        if A_i=A_leave then send to die: W2 m1 [7 m$ P2 Y; ?1 P, m- B6 {
        else inc A_i by 13 t2 A4 r4 l5 d7 A+ }
    end7 ]% H+ T2 J8 G9 e" q1 r7 Y: J+ [
end
1 z! u' S8 h2 _8 F% V6 V8 X: `1 \3 O7 G. s
其中的procindex为整形,代表当前process的序号。9 G1 Z8 B8 K  `9 s% s
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-4-22 00:19 , Processed in 0.015678 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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